如何将Numpy数组映射到具有特定成员的类中
perimeterValues = cv2.arcLength(curveData, True)
vertices = cv2.approxPolyDP(curveData, 0.04 * perimeterValues, True)
Results: [[[[257, 396]], [[225, 397]], [[210, 431]], [[235, 450]], [[265, 435]]]]
它需要进入一个包含离散类成员的列表类,如下所示:
verticesList : list[Vertices]
class Vertices():
xLocation: int
yLocation: int
在前面的尝试中,我将丢失类成员的名称xLocation、ylolocation等
目前没有回答
相关问题 更多 >
编程相关推荐