當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python cucim.skimage.filters.threshold_yen用法及代碼示例

用法:

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

根據日元的方法返回閾值。必須提供圖像或曆史記錄。如果給出 hist,則忽略圖像的實際直方圖。

參數

image(N, M) ndarray,可選

輸入圖像。

nbins整數,可選

用於計算直方圖的 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

相關用法


注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cucim.skimage.filters.threshold_yen。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。