I got the contours of source image. I have drawn 4 lines to approximate these contours:
- from minimum width to minimum height of contour.
- from minimum width to maximum height of contour.
- from maximum width to minimum height of contour.
- from maximum width to maximum height of contour.
I'd like to rotate this rectangle such that it is aligned to width (i.e. x-coordinate of image).