Ask Your Question
1

findcontour points order

asked 2017-06-20 11:47:51 -0600

Rok gravatar image

Hi, I'm using this function:

cv::findContours(frame, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);

Debugging my application I noticed that for any contour detected, the first point, contour[0], always is the topmost point, with the lowest y value. Is that really true? I didn't find any reference in the documentation about the point order. Is this a reliable way to find the topmost point of a contour?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-06-20 11:58:34 -0600

matman gravatar image

That's correct. The algorithm scans the image row by row and column by column until it finds the first point of a contour. After that the contour is traced by checking the points neighbours. So I think this should be a legal way to find topmost point of the contour.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-20 11:47:51 -0600

Seen: 2,335 times

Last updated: Jun 20 '17