在尝试使用opencv中的boundingRect()
函数时,我遇到了一个错误。给定的是一组点。
lists = []
for match in enumerate(matches):
lists.append(kp2[match.trainIdx].pt)
x,y,w,h = cv2.boundingRect(lists)
类型错误:points既不是numpy数组也不是标量
P / s:我想在图像中检测到的对象周围绘制一个矩形
任何帮助都会感激
编辑
更改之前的列表为np数组
[(328.0,227.0),(372.0,241.0),(366.0,229.0)]
更改后
[[328. 227.]
[372. 241.]
[366. 229.]]