【发布时间】:2018-10-10 16:12:03
【问题描述】:
我在 documenation 之后的 skimage 中定义了轮廓:
contours = measure.find_contours(img, 0.8)
在OpenCV区域可以使用:
cv2.contourArea(cnt)
skimage 是否包含类似的东西(轮廓特征的功能)?
【问题讨论】:
我在 documenation 之后的 skimage 中定义了轮廓:
contours = measure.find_contours(img, 0.8)
在OpenCV区域可以使用:
cv2.contourArea(cnt)
skimage 是否包含类似的东西(轮廓特征的功能)?
【问题讨论】:
我在 scikit-image 中没有找到任何类似的函数,但是通过对数据进行一些操作,您可以使用 opencv 中的函数。您只需要扩展numpy对象并将其转换为float32 UMat。
# Expand numpy dimensions
c = np.expand_dims(countour.astype(np.float32), 1)
# Convert it to UMat object
c = cv2.UMat(c)
area = cv2.contourArea(c)
【讨论】: