outImg,outThreshold = | kittlerThresholdImg (inImg) |
scalar = | kittlerThresholdImg (inImg,outBinImg) |
outImg,outThreshold = | kittlerThresholdImg (inImg,histogram) |
scalar = | kittlerThresholdImg (inImg,histogram,outBinImg) |
Compute the Kittler threshold of an input image, and binarize the image using this threshold.
Kittler's method is used to automatically perform the binarization of an input image [1]. It assumes that the image is bi-modal (pixel intensities can be distinguished in 2 classes: background pixels and foreground pixels and that each mode can be approximated by a Gaussian. It then calculates the optimal threshold that separates these 2 classes, by minimizing the error :
On output, binarized image values are given by:
with the threshold computed from Kittler's method.
Input and output images must have same size and buffer type.
Here is an example of automatic Kittler image thresholding applied to a 8-bits grey level image (on ouput, computed threshold equals 65) :
[1] Kittler, J. & Illingworth, J. Minimum error thresholding Pattern Recognition, 1986, 19, 41 - 47