(-5:Bad argument) in function ‘rectangle’ – Can’t parse ‘pt1’. Sequence item with index 0 has a wrong type

The problem is that you are passing tuples with floats into the function’s parameters as the points. Here is the error reproduced: import cv2 import numpy as np img = np.zeros((600, 600), ‘uint8’) c1 = 50.2, 12.4 c2 = 88.8, 40.8 cv2.rectangle(img, c1, c2, (255, 0, 0), -1) Output: Traceback (most recent call last): File … Read more