How do I change the angle of a cv2 rectangle?
It's already some time I used it, but as far as I remember, all these ROI types are just plain x-y rectangles. No rotation is possible (you can also see from the constructors, there is no way how to define the rotation). So it is always wide along x-axis and high along y-axis.
If you want to just draw rectangle, I propose to just determine all four corner points and then by simple lines draw the bounding box. Eventually you can use polylines to do it in one command.
I am using a cv2 rectangle for bounding box purposes and I want to rotate it about its axis by some angle. Since the warpAffine function is used to rotate images, I am unable to use it here.