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


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


用法:

skimage.filters.threshold_yen(image=None, nbins=256, *, hist=None)

根据日元的方法返回阈值。必须提供图像或历史记录。如果给出 hist,则忽略图像的实际直方图。

参数

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

灰度输入图像。

nbinsint 可选

用于计算直方图的 bin 数量。对于整数数组,此值将被忽略。

hist数组,或数组的 2 元组,可选

从中确定阈值的直方图,以及可选的相应 bin 中心强度数组。此函数的另一种用法是仅传递 hist。

返回

threshold浮点数

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

参考

1

Yen J.C., Chang F.J., and Chang S. (1995) “A New Criterion for Automatic Multilevel Thresholding” IEEE Trans. on Image Processing, 4(3): 370-378. DOI:10.1109/83.366472

2

Sezgin M. and Sankur B. (2004) “Survey over Image Thresholding Techniques and Quantitative Performance Evaluation” Journal of Electronic Imaging, 13(1): 146-165, DOI:10.1117/1.1631315 http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf

3

ImageJ AutoThresholder code, http://fiji.sc/wiki/index.php/Auto_Threshold

例子

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

相关用法


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