【发布时间】:2017-01-12 05:50:35
【问题描述】:
【问题讨论】:
标签: android opencv opencv4android opencv-contour
【问题讨论】:
标签: android opencv opencv4android opencv-contour
如果你的大矩形总是有这么好的边缘(没有孔的边缘),并且这个矩形内的所有组件总是明显更小,你可以使用connectedComponentsWithStats(),它将产生具有长度的边缘,然后选择最长的边。在 Python 中:
nb_edges, output, size, centroids = cv2.connectedComponentsWithStats(image, connectivity=8)
#then select the edge with the biggest size
【讨论】:
connectedComponentsWithStats 我发现了一个标记图像,它只有具有闭合路径的内部组件,以及一个包含这些组件的矩形的统计矩阵。我应该在哪里寻找线条?