Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 220.127.116.11 (18.104.22.168)
public class SISThreshold : BaseInPlacePartialFilter
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.
// create filter SISThreshold filter = new SISThreshold( ); // apply the filter filter.ApplyInPlace( image );
Result image (calculated threshold is 127):