如何将EDlines算法提取的近似相接线段组合为完整矩形框?
矩形框线段拼接与角点检测求助
我需要从包含矩形框的图像中检测角点,目前已通过EDlines算法提取出棋盘的边缘线段,但在将这些近似相接的线段组合成完整矩形框时遇到困难,恳请提供技术帮助。
相关代码如下:
ed_anti=cvX.createEdgeDrawing() ed_anti.detectEdges(binarized) edges_anti=ed_anti.getEdgeImage(None) segments_anti=ed_anti.getSegments()#gets the segments of the edges gradiant_anti=ed_anti.getGradientImage(None)#detects the gradient of the edges ed_lines_anti=ed_anti.detectLines(None)#detects the lines if ed_lines_anti is not None: lines_anti = np.uint16(np.around(ed_lines_anti)) for i in range(len(ed_lines_anti)): cv.line(anti_black_image, (lines_anti[i][0][0], lines_anti[i][0][1]), (lines_anti[i][0][2], lines_anti[i][0][3]), (250, 0, 250), 1, cv.LINE_AA)
线段提取后的效果图像:
内容的提问来源于stack exchange,提问作者norb
相关产品推荐
相关产品推荐

