如何把 CvSeq 转去CvPoint和如何从CvPoint写入CvSeq

 CvPoint* point = new CvPoint[length]; //分配轮廓点

 int i;
 for (i = 0; i < length; i++)
        point[i]=*CV_GET_SEQ_ELEM(CvPoint,contours,i);//一个一个的读取数据

 

CvMemStorage* storage1 = cvCreateMemStorage(0);
CvSeq* seq = cvCreateSeq( CV_32SC2, /* sequence of points */
               sizeof(CvSeq), /* header size - no extra fields */
              sizeof(CvPoint), /* element size */
              storage1 /* the container storage */ );
 for( i = 0; i <length; i++ )
       cvSeqPush( seq,&point[i]);

你可能感兴趣的:(header)