использование: CvSeq* convex_hull=cvConvexHull2( &point_mat, &hull_mat, CV_CLOCKWISE, **1** ); // !!
мой код:
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq* contours = 0;
cvFindContours(bordImage, storage, &contours, sizeof(CvContour),
CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0));
for(CvSeq* seq = contours; seq != 0; seq = seq->h_next){
cvDrawContours(dstImage, seq, CV_RGB(255,216,0), CV_RGB(0,0,250), 0, 1, 8);
}
CvMemStorage* hullStorage = cvCreateMemStorage(0);
for(CvSeq* seq = contours; seq != 0; seq = seq->h_next){
CvSeq *hulls = cvConvexHull2(seq, hullStorage, CV_CLOCKWISE, 1);
cvDrawContours(dstImage, hulls, CV_RGB(255, 0, 0), CV_RGB(100, 0, 0), 0, 1, 8);
for (int i = 0; i < hulls->total; i++) {
CvPoint* p = (CvPoint*)cvGetSeqElem ( hulls, i );
// ...
}
cvClearMemStorage(hullStorage);
}