Hi,
When the blobs are extracted the contours are stored in chain codes format. So, firstly you must use "cvConvertChainCodesToPolygon" to convert to a list of vertex. The problem is this polygon will be a lot of vertex so you will need to simplify, for example:
CvContourPolygon *polygon = cvConvertChainCodesToPolygon(it->second->contour);
CvContourPolygon *sPolygon = cvSimplifyPolygon(polygon, 5.);
Then, you can iterate trough the vertex:
CvContourPolygon::const_iterator it=sPolygon->begin();
|
|
if (it!=contour->end())
|
{
|
|
x = it->x;
|
y = it->y;
// ...
|
|
| } |
I hope the code is almost right ;)
Best,
Cristóbal