Ask Your Question
0

Ensure constant image size

asked 2014-06-01 16:09:41 -0600

Luek gravatar image

I am using the findContours() function to find a business card in an image, however sometimes the card is very small in the image. It still finds the card but when I go to do further processing on the image I get unexpected results from cards due to the inconsistency in size of the card.

How can I take outImg and ensure it is always of size x,y?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-01 16:53:13 -0600

Witek gravatar image

updated 2014-06-01 16:53:43 -0600

I don't know if I understand the problem, but once you find the card, you should find its 4 corners and calculate the perspective transform to a rectangle of a predefined size. After warping, your card will always have the same dimensions.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-06-01 16:09:41 -0600

Seen: 140 times

Last updated: Jun 01 '14