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


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

用法:

cucim.skimage.filters.apply_hysteresis_threshold(image, low, high)

將滯後閾值應用於 image

此算法查找 image 大於 highimage 大於 low and 該區域連接到大於 high 的區域的區域。

參數

image數組,形狀(M,[N,...,P])

灰度輸入圖像。

low浮點數,或與 image 形狀相同的數組

較低的門檻。

high浮點數,或與 image 形狀相同的數組

門檻較高。

返回

thresholded布爾數組,與 image 的形狀相同

True 表示image 高於滯後閾值的位置的數組。

參考

1

J. Canny. A computational approach to edge detection. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1986; vol. 8, pp.679-698. DOI:10.1109/TPAMI.1986.4767851

例子

>>> import cupy as cp
>>> from cucim.skimage.filters import apply_hysteresis_threshold
>>> image = cp.asarray([1, 2, 3, 2, 1, 2, 1, 3, 2])
>>> apply_hysteresis_threshold(image, 1.5, 2.5).astype(int)
array([0, 1, 1, 1, 0, 0, 0, 1, 1])

相關用法


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