我试图在图像上方可视化边界框。
我的代码:
color = (255, 255, 0)
thickness = 4
x_min, y_min, x_max, y_max = bbox
cv2.rectangle(img, (x_min, y_min), (x_max, y_max), color, thickness=thickness)
我得到了一个TypeError: Argument given by name ('thickness') and position (4)
错误。即使我按位置传递thickness参数,我也会得到不同的跟踪信息:
cv2.rectangle(img, (x_min, y_min), (x_max, y_max), color, thickness)
抛出 TypeError:预期元组。
print(type(thickness)
和print(thickness)
,这样我们就可以追踪发生了什么? - Shawn Mathew