现在的位置: 首页 > 综合 > 正文

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

2013年08月29日 ⁄ 综合 ⁄ 共 428字 ⁄ 字号 评论关闭

 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]);

抱歉!评论已关闭.