scalar = | kittlerThreshold (inImg) |
scalar = | kittlerThreshold (inImg,histogram) |
Computation of the binary threshold on one image, using Kittler method.
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 :
Where is the cumulated histogram for the class
and
is the associated standard deviation :
With being the number of pixel in the image and
the histograme value for the intensity
.
[1] Kittler, J. & Illingworth, J. Minimum error thresholding Pattern Recognition, 1986, 19, 41 - 47