1

I have an image filled with objects and I am able to draw bounding boxes around them, thanks to the minAreaRect function.

enter image description here

Those rectangles are rotated. I want to retrieve images, containing only the inside of the rectangles that would be rotated by its angle, so that all objects are oriented upwards.

I know I have some functions to do so : getRotationMatrix, warpAffine, etc. The problem is that I still haven't found the process to have my results. Some steps are needed, such as : setting the rectangle on the center of a fixed-size image, rotate it, and then crop what I want. But it's not as easy as it seems...

Has anyone ever done this before ? Any help would be appreciated. :) Thanks !

  • 1
    Possible duplicate of [Crop Rectangle returned by minAreaRect OpenCV \[Python\]](https://stackoverflow.com/questions/37177811/crop-rectangle-returned-by-minarearect-opencv-python) – alkasm Jul 18 '17 at 22:48

0 Answers0