我正在尝试对3维以上的数组执行connected component labling。我的意思是,我的布尔数组有一个.shape
,比如像(5,2,3,6,10)
,它是5维的
对于2D图像(而不是我的>;3D问题),连接的组件标签将是将标签放置到连接的区域(在我的例子中是超卷)。如果两个(hpyer-)像素彼此相邻且在布尔数组中均为真,则两个(hpyer-)像素将连接起来
对于2维can be done with OpenCV和最多3维,这可以通过scikit-image's{
为感兴趣的读者提供更多资料(但对我的问题没有帮助):
如果2D中的4连接性就足够了,您可以使用最近邻树在n log n时间内获得同样是前景的相邻像素。 然后是构造图和查找连接的组件(也就是n logn,IIRC)的问题
对于形状为(50,50,50,50)的阵列,我在笔记本电脑上获得以下计时:
^{} 直接执行您想要的操作:
相关问题 更多 >
编程相关推荐