threshold-otsu

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
doc_scikit_image
2017-01-12 17:23:48
Comments
Leave a Comment

Please login to continue.