scalar = | isoDataThreshold (inImg) |
computation of iso data threshold on one image
Isodata-based method, also known as Ridler-Calvard method [1] [2], 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) and calculate the optimal threshold that separates these 2 classes. This algorithm was proposed by Ridler-Calvard in 1978 , and defines the threshold as the equidistant value between the average intensities of both classes:
Where is the mean intensity of the background pixels and
is the mean intensity of the foreground pixels.
An admissible threshold is close to the bin , used to define the background and foreground classes:
Where is the histogram value for the bin
and
is the width of this bin.
If thresholds are found, the algorithm retains the minimum and maximum thresholds respecting the previous assertion and returns the mean value between their average.
On the contrary, if no threshold has been found, the algorithm returns NumericLimits<ipsdk::ipReal64>::max().
[1] "Picture Thresholding Using an Iterative Selection Method", T. W. Ridler and S. Calvard, IEEE Transactions on Systems, Man, and Cybernetics, pages 630-632, August 1978
[2] "Survey over image thresholding techniques and quantitative performance evaluation", M. Sezgin and B. Sankur, Journal of Electronic Imaging, pages 146-168, January 2004