ThresholdMethod Enum

Selects how ImageProcessingExtensions.Threshold chooses the threshold of each pixel.

public enum ThresholdMethod

Fields

NameValueDescription
Otsu0One threshold for the whole frame, chosen by Otsu's method from the histogram of its luminance (ImageHistogram.GetOtsuThreshold): the level that maximizes the variance between the two classes. This is the default.
Fixed1One threshold for the whole frame: ThresholdOptions.Level.
Mean2An adaptive threshold: the mean luminance of the ThresholdOptions.WindowSize square centered on the pixel, minus ThresholdOptions.Offset. It follows uneven lighting, such as the shadows of a scanned or photographed page.
Sauvola3An adaptive threshold for documents (Sauvola and Pietikäinen, 2000): m * (1 + k * (s / R - 1)), where m and s are the mean and the standard deviation of the luminance in the ThresholdOptions.WindowSize square centered on the pixel, k is ThresholdOptions.SauvolaK and R is ThresholdOptions.SauvolaR. Where the window has little contrast, the threshold falls below the mean, so a blank background stays blank.