1 | initial version |
You first need to use the function cv::rotatedRect::boundingRect which returns you a rotatedRect object from which you can derive the angle as a float parameter!
2 | No.2 Revision |
You first need to use the function cv::rotatedRect::boundingRect which returns you a rotatedRect object from which you can derive the angle as a float parameter!
3 | No.3 Revision |
You first need to use the function cv::rotatedRect::boundingRect which returns you a rotatedRect object from which you can derive the angle as a float parameter!
UPDATE
Ow excuse me :) What you should do is rotate the image over the angle to obtain a rectangular bounding box and then crop it out. That would be the fastest way. Rotating an image around a point is illustrated here, which is a Python tutorial but the idea in C++ is exactly the same.