cv2.rectangle(imag_np,(left,top),(left+width,top+height),(0,255,0),2)
TypeError: function takes exactly 4 arguments (2 given)
画矩形框的时候报的错。解决办法:将float32转成整型。
原代码:
cv2.rectangle(imag_np,(left,top),(left+width,top+height),(0,255,0),2)
现代码:
cv2.rectangle(imag_np,(int(left),int(top)),(int(left+width),int(top+height)),(0,255,0),2)