Question

My problems is I want to find 4 corners of rectangles after using cvfindcontours ? Here is my result:

image:
enter image description here

How can I find 4 corners of each rectangle? I think the building function Cv find and draw contours have their information of the corners, so how can I read it?

No correct solution

OTHER TIPS

(modified from here)

// Find the rotated rectangles for each contour
vector<cv::RotatedRect> cv::minRect( contours.size() );

for( size_t = 0; i < contours.size(); i++ )
{
    minRect[i] = minAreaRect( cv::Mat(contours[i]) );
}

If you want the actual points on the contour, you can later find for each contour the points that is closest to each of the corners of the RotatedRect

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top