Sorry, this content is no longer available

Ask Your Question
1

Find skew of bounding box

asked Jun 5 '14

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.

Preview: (hide)

2 answers

Sort by » oldest newest most voted
1

answered Jun 6 '14

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

Preview: (hide)
1

answered Jun 5 '14

updated Jun 5 '14

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

Preview: (hide)

Question Tools

Stats

Asked: Jun 5 '14

Seen: 2,436 times

Last updated: Jun 06 '14