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


Python skimage.segmentation.join_segmentations用法及代码示例

用法:

skimage.segmentation.join_segmentations(s1, s2)

返回两个输入分段的连接。

S1 和 S2 的连接 J 定义为两个体素在同一段中当且仅当它们在 S1 和 S2 中的同一段中的分割。

参数

s1, s2numpy 数组

s1 和 s2 是相同形状的标签字段。

返回

jnumpy 数组

s1 和 s2 的连接分割。

例子

>>> from skimage.segmentation import join_segmentations
>>> s1 = np.array([[0, 0, 1, 1],
...                [0, 2, 1, 1],
...                [2, 2, 2, 1]])
>>> s2 = np.array([[0, 1, 1, 0],
...                [0, 1, 1, 0],
...                [0, 1, 1, 1]])
>>> join_segmentations(s1, s2)
array([[0, 1, 3, 2],
       [0, 5, 3, 2],
       [4, 5, 5, 3]])

相关用法


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