我试图用分水岭算法分割三维断层图像。在
{I>这里是^我的代码段:
D = ndimage.distance_transform_edt(a)
localMax = feature.peak_local_max(D, indices=False, min_distance=30,
labels=a,threshold_abs=6,exclude_border=1)
localMax2 = feature.peak_local_max(D, indices=True, min_distance=30,
labels=a,threshold_abs=6,exclude_border=1)
markers = ndimage.label(localMax, structure=np.ones((3,3,3)))[0]
labels = morphology.watershed(-D,markers,mask=a)
问题是该算法对区域进行过分割,见图片(左侧为原始断层图,中间为欧氏距离图带种子点(红点),右侧为分割图像)。如果我使用较少的种子点,我不会得到所有的区域。有没有办法合并相邻区域?在
目前没有回答
相关问题 更多 >
编程相关推荐