【发布时间】:2016-09-18 11:34:01
【问题描述】:
我想从图像中删除一些轮廓,但我不知道如何使用skimage 来实现它?我在OpenCV 中使用drawContour 做了类似的事情,但我在skimage 中找不到等价物。
假设我有一个简单的图像,例如:
0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0
0 0 1 0 0 1 0 0
0 0 1 1 1 1 0 0
0 0 0 0 0 0 0 0
只有一个连通分量。
我需要通过掩盖它来删除它。
最终结果将是一个 8 * 5 的零矩阵!
a = '''0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0
0 0 1 0 0 1 0 0
0 0 1 1 1 1 0 0
0 0 0 0 0 0 0 0'''
np.array([int(i) for i in a.split()], dtype=bool).reshape(5, 8)
cc = measure.regionprops(measure.label(a))[0]
# here is what I do for removing cc
我应该怎么做才能使用skimage删除cc连接的组件?
【问题讨论】:
标签: python image-processing scikit-image