{TypeError}argument for rectangle() given by name (‘thickness‘) and position

x33g5p2x  于2021-11-15 转载在 其他  
字(0.6k)|赞(0)|评价(0)|浏览(490)

{TypeError}argument for rectangle() given by name ('thickness') and position

img = cv.rectangle( img, pt1, pt2, color[, thickness[, lineType[, shift]]] )
img = cv.rectangle( img, rec, color[, thickness[, lineType[, shift]]] )

问题
{TypeError}an integer is required (got type tuple)
{TypeError}argument for rectangle() given by name (‘color’) and position (3)
{TypeError}argument for rectangle() given by name (‘thickness’) and position (4)
{TypeError}an integer is required (got type tuple)
————————————————

原文链接:https://blog.csdn.net/csdn_zhishui/article/details/105878092

解决办法

  • 坐标pt1,pt2需要是整型
  • img=np.ascontiguousarray(img),然后调用rectangle

相关文章