在从 cv2.findContours 中检测到的轮廓列表中,从特定轮廓中提取特定坐标
Extracting specific coordinates from a specific contour, within a contours list that was detected from cv2.findContours
我有一个如下所示的多维数组
Contour[0] = [[(x1,y1),(x2,y2),(x3,y3)]]
Contour[1] = [[(x4,y4),(x5,y5),(x6,y6),(x7,y7),(x8,y8)]]
如何从 contour[0]
中提取 (x1,y1)
和 (x3,y3)
以及从 contour[1]
中提取 (x4,y4)
和 (x8,y8)
?
Contour[0][0][0] ---> ('x1', 'y1')
Contour[1][0][0] ---> ('x4', 'y4')
Contour[1][0][4] ---> ('x8', 'y8')
我有一个如下所示的多维数组
Contour[0] = [[(x1,y1),(x2,y2),(x3,y3)]]
Contour[1] = [[(x4,y4),(x5,y5),(x6,y6),(x7,y7),(x8,y8)]]
如何从 contour[0]
中提取 (x1,y1)
和 (x3,y3)
以及从 contour[1]
中提取 (x4,y4)
和 (x8,y8)
?
Contour[0][0][0] ---> ('x1', 'y1')
Contour[1][0][0] ---> ('x4', 'y4')
Contour[1][0][4] ---> ('x8', 'y8')