threshold-isodata

threshold_isodata

skimage.filters.threshold_isodata(image, nbins=256, return_all=False) [source]

Return threshold value(s) based on ISODATA method.

Histogram-based threshold, known as Ridler-Calvard method or inter-means. Threshold values returned satisfy the following equality:

threshold = (image[image <= threshold].mean() +
image[image > threshold].mean()) / 2.0

That is, returned thresholds are intensities that separate the image into two groups of pixels, where the threshold intensity is midway between the mean intensities of these groups.

For integer images, the above equality holds to within one; for floating- point images, the equality holds to within the histogram bin-width.

Parameters:

image : array

Input image.

nbins : int, optional

Number of bins used to calculate histogram. This value is ignored for integer arrays.

return_all: bool, optional

If False (default), return only the lowest threshold that satisfies the above equality. If True, return all valid thresholds.

Returns:

threshold : float or int or array

Threshold value(s).

References

[R198] Ridler, TW & Calvard, S (1978), “Picture thresholding using an iterative selection method”
[R199] IEEE Transactions on Systems, Man and Cybernetics 8: 630-632, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4310039
[R200] Sezgin M. and Sankur B. (2004) “Survey over Image Thresholding Techniques and Quantitative Performance Evaluation” Journal of Electronic Imaging, 13(1): 146-165, http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf
[R201] ImageJ AutoThresholder code, http://fiji.sc/wiki/index.php/Auto_Threshold

Examples

>>> from skimage.data import coins
>>> image = coins()
>>> thresh = threshold_isodata(image)
>>> binary = image > thresh
doc_scikit_image
2017-01-12 17:23:47
Comments
Leave a Comment

Please login to continue.