Ask Your Question

Find skew of bounding box

asked 2014-06-05 00:16:28 -0500

Luek gravatar image

I am find a business card in an image and sometimes the card is slightly skewed, how can I find the skew of the bounding box of the card?

I am using the findContours() function to find the contours and then finding the largest contour. Storing the card in... cv::Rect bounding_rect;

How can I find the skew of boudning_rect? I have a function to deskew but I am having a hard time finding the skew.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-06-06 08:31:03 -0500

I suggest minAreaRect which gives you the smalles rotated rectangle that contains all given points. The result cv::RotatedRect has a member angle.

edit flag offensive delete link more

answered 2014-06-05 04:29:29 -0500

updated 2014-06-05 04:31:31 -0500

See the function fitEllipse which returns the rotated bounding box for a points set.

edit flag offensive delete link more

Question Tools


Asked: 2014-06-05 00:16:28 -0500

Seen: 1,999 times

Last updated: Jun 06 '14