Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Editing/Understanging FindContours Points

I am using OpenCV 3.1.1 with VS2012 C++ on a Win10 64 bit machine.

I am attempting to implement Xingang, et al., "Bag of Contour Fragments for Robust Shape Classification" (2014). http://dl.acm.org/citation.cfm?id=258. That approach involves editing the points of a contour to eliminate non-essential points.

I used findContours with CHAIN_APPROX_SIMPLE. That outputs an array of CV::Points. What I am hoping to understand is if, or how, the points are ordered. That is, given a list of points, how do you know which points are next to each other on the contour? Seems like once you have more than four points, a variety of connections between the points is possible.

Related to that, how does drawContours interpret the points array to decide which points to connect with lines?

If there is any documentation which describes any of this, a reference to it would be great.

Thanks

Editing/Understanging FindContours Points

I am using OpenCV 3.1.1 with VS2012 C++ on a Win10 64 bit machine.

I am attempting to implement Xingang, et al., "Bag of Contour Fragments for Robust Shape Classification" (2014). http://dl.acm.org/citation.cfm?id=258. http://dl.acm.org/citation.cfm?id=2589350 That approach involves editing the points of a contour to eliminate non-essential points.

I used findContours with CHAIN_APPROX_SIMPLE. That outputs an array of CV::Points. What I am hoping to understand is if, or how, the points are ordered. That is, given a list of points, how do you know which points are next to each other on the contour? Seems like once you have more than four points, a variety of connections between the points is possible.

Related to that, how does drawContours interpret the points array to decide which points to connect with lines?

If there is any documentation which describes any of this, a reference to it would be great.

Thanks

Editing/Understanging FindContours Points

I am using OpenCV 3.1.1 with VS2012 C++ on a Win10 64 bit machine.

I am attempting to implement Xingang, et al., "Bag of Contour Fragments for Robust Shape Classification" (2014). http://dl.acm.org/citation.cfm?id=2589350 That approach involves editing the points of a contour to eliminate non-essential points.

I used findContours with CHAIN_APPROX_SIMPLE. That outputs an array of CV::Points. What I am hoping to understand is if, or how, the points are ordered. That is, given a list of points, how do you know which points are next to each other on the contour? Seems like once you have more than four points, a variety of connections between the points is possible.

Related to that, how does drawContours interpret the points array to decide which points to connect with lines?

If there is any documentation which describes any of this, a reference to it would be great.

Thanks