Packagede.popforge.imageprocessing.filters.binarization
Classpublic final class CarryThreshold
ImplementsIFilter

The CarryThreshold class transforms a grayscale image into binary color-space using a carry flag.

The filter checks each pixel and adds the brightness to the carry flag. If the flag is greater than a threshold value of 0x7f the pixel will be set to 1 otherwise to 0.

The formula of this filter is new = ( flag += old > threshold ) ? 1, flag -= 0xff : 0.

Supported formats:
This is a conversion filter so there are no supported formats.


Example
  
  // Set the conversion filter to CarryThreshold
  Image.threshold = new CarryThreshold();
  
  var video: WebCam = new WebCam( 160, 120 );
  var image: Image = new Image( 160, 120, ImageFormat.BINARY );
  
  image.loadBitmapData( video.getCurrentFrame(), true );
  



Public Methods
 MethodDefined by
  
apply(image:Image):void
Applies the filter to the given Image object.
CarryThreshold
  
toString():String
Builds and returns a string containing the name of the class.
CarryThreshold
Method detail
apply()method
public function apply(image:Image):void

Applies the filter to the given Image object.

Parameters
image:Image — The image that will be manipulated.
toString()method 
public function toString():String

Builds and returns a string containing the name of the class.

Returns
String — A string containing the name of the class.