Threshold using Simple Image Statistics (SIS).
Namespace:
AForge.Imaging.FiltersAssembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
C# |
---|
public class SISThreshold : BaseInPlacePartialFilter |
Remarks
The filter performs image thresholding calculating threshold automatically using simple image statistics method. For each pixel:
- two gradients are calculated - ex = |I(x + 1, y) - I(x - 1, y)| and |I(x, y + 1) - I(x, y - 1)|;
- weight is calculated as maximum of two gradients;
- sum of weights is updated (weightTotal += weight);
- sum of weighted pixel values is updated (total += weight * I(x, y)).
The filter accepts 8 bpp grayscale images for processing.
Sample usage:

// create filter SISThreshold filter = new SISThreshold( ); // apply the filter filter.ApplyInPlace( image );
Initial image:

Result image (calculated threshold is 127):

Inheritance Hierarchy
System..::.Object
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.SISThreshold
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.SISThreshold