1 2 3 4 5 6 7 8 9 10 11 12 13
|
for(int i=0; i<_contour.blobs.size(); i++){
//table for translation in openCv types (ofPoint -> cvPoint)
cvPoint** tableau_points;
tableau_points = (cvPoint**) malloc(sizeof(cvPoint*)*_contour.blobs[i].pts.size());
//set all the blob contour in a table to draw a fill polygon
for(int j=0; j<_contour.blobs[i].pts.size(); j++){
cvPoint* ptr = &cvPoint(_contour.blobs[i].pts[j].x, _contour.blobs[i].pts[j].y);
tableau_points[j] = ptr;
}
cvFillPoly(outputImage.getCvImage(), tableau_points, &(_contour.blobs.nPts), _contour.blobs.nPts, cvScalar(255,255,255), 8);
} |
Partager