scalar = | kapurThreshold (inImg) |
scalar = | kapurThreshold (inImg,histogram) |
Computation of the binary threshold on one image, using Kapur method.
Kapur's method is used to automatically perform the binarization of an input image. It assumes that the image is bi-modal (pixel intensities can be distinguished in 2 classes: background pixels and foreground pixels). It then calculates the optimal threshold that separates these 2 classes, by maximizing the sum of their entropies [1].
[1] Kapur, J.; Sahoo, P. & Wong, A., "A new method for gray-level picture thresholding using the entropy of the histogram", Computer Vision, Graphics, and Image Processing, 1985, 29, 273 - 285