Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Crop image based on largest quadrilateral contour OpenCV

I am in high school and I am working on a project to build an iOS app that lets users scan business cards, currently I am working on edge detection on the card. I believe I have it working correctly and it is drawing the outline of the card and some other shadows ect.

Here is a sample image I got back while scanning, I should probably convert to grayscale which I'll do as well.

How can I find the largest quadrilateral and crop my image to included only the card? All of my contours are stored in a vector<vector<cv::Point> > The green line seems to be the one I'd be interested in.

enter image description here

click to hide/show revision 2
retagged

updated 2014-03-19 07:38:23 -0600

berak gravatar image

Crop image based on largest quadrilateral contour OpenCV

I am in high school and I am working on a project to build an iOS app that lets users scan business cards, currently I am working on edge detection on the card. I believe I have it working correctly and it is drawing the outline of the card and some other shadows ect.

Here is a sample image I got back while scanning, I should probably convert to grayscale which I'll do as well.

How can I find the largest quadrilateral and crop my image to included only the card? All of my contours are stored in a vector<vector<cv::Point> > The green line seems to be the one I'd be interested in.

enter image description here