当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python skimage.filters.threshold_mean用法及代码示例


用法:

skimage.filters.threshold_mean(image)

根据灰度值的平均值返回阈值。

参数

image(N, M[, ..., P]) ndarray

灰度输入图像。

返回

threshold浮点数

上阈值。强度高于此值的所有像素都被假定为前景。

参考

1

C. A. Glasbey, “An analysis of histogram-based thresholding algorithms,” CVGIP: Graphical Models and Image Processing, vol. 55, pp. 532-537, 1993. DOI:10.1006/cgip.1993.1040

例子

>>> from skimage.data import camera
>>> image = camera()
>>> thresh = threshold_mean(image)
>>> binary = image > thresh

相关用法


注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.filters.threshold_mean。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。