threshold_otsu
-
skimage.filters.threshold_otsu(image, nbins=256)
[source] -
Return threshold value based on Otsu’s method.
Parameters: image : array
Grayscale input image.
nbins : int, optional
Number of bins used to calculate histogram. This value is ignored for integer arrays.
Returns: threshold : float
Upper threshold value. All pixels intensities that less or equal of this value assumed as foreground.
Notes
The input image must be grayscale.
References
[R206] Wikipedia, http://en.wikipedia.org/wiki/Otsu’s_Method Examples
>>> from skimage.data import camera >>> image = camera() >>> thresh = threshold_otsu(image) >>> binary = image <= thresh
Please login to continue.