| Package | de.popforge.imageprocessing.filters.binarization |
| Class | public final class Threshold |
| Implements | IFilter |
The filter checks each pixel if it is greater or equal to the threshold value. If this condition is true then the resulting pixel is set to 1 otherwise to 0. This filter is working with a look-up table and can be overriden by another threshold filter that uses a different technique to create the look-up table.
The formula of this filter is new = ( old > threshold ) ? 1 : 0.
Supported formats:
This is a conversion filter so there are no supported formats.
// Set the conversion filter to Threshold Image.threshold = new Threshold(); var video: WebCam = new WebCam( 160, 120 ); var image: Image = new Image( 160, 120, ImageFormat.BINARY ); image.loadBitmapData( video.getCurrentFrame(), true );
| Method | Defined by | ||
|---|---|---|---|
|
Threshold(thresholdValue:int = 0x80)
Creates a new Threshold object with given threshold value.
| Threshold | ||
|
Applies the filter to the given Image object.
| Threshold | ||
|
toString():String
Builds and returns a string containing the name of the class.
| Threshold | ||
| Method | Defined by | ||
|---|---|---|---|
|
updateTable():void
Creates the look-up table.
| Threshold | ||
| Threshold | () | constructor |
public function Threshold(thresholdValue:int = 0x80)Creates a new Threshold object with given threshold value.
ParametersthresholdValue:int (default = 0x80) — The threshold value (0 to 0xff).
|
| apply | () | method |
public function apply(image:Image):voidApplies the filter to the given Image object.
Parametersimage:Image — The image that will be manipulated.
|
| toString | () | method |
public function toString():StringBuilds and returns a string containing the name of the class.
ReturnsString — A string containing the name of the class.
|
| updateTable | () | method |
protected function updateTable():voidCreates the look-up table. Can be overridden by another filter using a look-up table. If you want to create a general look-up table based filter you should check de.popforge.imageprocessing.filters.color.LUTFilter.
See also