python中是否有一个等效于matlab的“ bwconncomp”和“ label matrix”的函数?

问题描述 投票:0回答:1

我目前有一个matlab脚本,而不是我想用python编写的脚本,我想知道python中是否有等效于“ bwconncomp”和“ label matrix”的函数可以评估多维二进制数组。

python matlab image-processing multidimensional-array 3d
1个回答
0
投票

使用skimage库,您可以标记离散图像的连接组件。当两个像素相邻时,两个像素具有相同的值。在2D模式下,它们可以是1或2连接的邻居。

from skimage import measure
all_labels = measure.label(blobs)

您可以找到更多详细信息herehere

© www.soinside.com 2019 - 2024. All rights reserved.