I've run into a curious error. After applying np.flip, cv2.rectangle is throwing an error. Here's a minimal reproducible example:
image = np.random.choice(255,(50,50,3)).astype(np.uint8)
image_180 = np.flip(image.copy())
x1,y1,x2,y2 = 20,20,30,30
cv2.rectangle(image,(x1,y1),(x2,y2),(0,255,0),1)
cv2.rectangle(image_180,(x1,y1),(x2,y2),(0,255,0),1)
Both image and image_180 are of the type numpy.ndarray, and are of dtype np.uint8. However, the second call to rectangle throws the following error:
TypeError: an integer is required (got type tuple)
Which makes no sense. I'm assuming this is a bug or something with a lazy fix.