opencv.rectangle got TypeError:tuple type

当从Image或numpy生成的图像矩阵中包含不一样类型的数据时候,则会致使此问题。 采用以下进行连续array,则解决此问题python nps=np.ascontiguousarray(nps,dtype=np.uint8) cv2.rectangle(nps,(x1,y1),(x2,y2),(0,255,0),-1)
相关文章
相关标签/搜索