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


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。