将点转化为轮廓cvSeq 失败
OpenCV Error: Bad argument (Unsupported sequence type) in cvContourArea
/**
CvMemStorage* memStorage = cvCreateMemStorage();
//CvSeq* blobContour = cvCreateSeq( CV_SEQ_KIND_GENERIC|CV_32SC2, sizeof(CvContour), sizeof(CvPoint), memStorage);
CvSeq* blobContour = cvCreateSeq(CV_SEQ_ELTYPE_POINT,sizeof(CvSeq), sizeof(CvPoint), memStorage);
CvRect r ;
for(int point=0;point<pointNum-1;point++)
{
int size =blobContours[point].size();
for(int i=0;i<size;i++)//是>=0
{//将点集转化为轮廓
cvSeqPush(blobContour,&blobContours[point][i]);
}
//test
int test1 = (((1<<2-1)<<12));
CvPoint* Array1;
int Total1 = blobContour->total;
Array1 = (CvPoint*)malloc(sizeof(CvPoint)*Total1);
cvCvtSeqToArray(blobContour,Array1, CV_WHOLE_SEQ);
CvPoint test;
for (int i=0;i<Total1;i++)
{
test = Array1[i];
}
r = ((CvContour*)blobContour)->rect;
//test
float area = cvContourArea(blobContour);
//end test
if(area>0)
{//满度面积比
//OK进行并行识别
cvDrawContours(pImgContourShow, blobContour, CV_RGB(0, 255, 0), CV_RGB(0, 222, 0), 0, 1, 8, cvPoint(0, 0) );
}
}
*////
源代码:
if( CV_IS_SEQ( array ))
{}
01540 #define CV_IS_SEQ_POLYLINE( seq ) \ 01541 (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE && CV_IS_SEQ_POINT_SET(seq)
01521 #define CV_SEQ_KIND( seq ) ((seq)->flags & CV_SEQ_KIND_MASK )
01473 #define CV_SEQ_KIND_BITS 2 01474 #define CV_SEQ_KIND_MASK (((1 << CV_SEQ_KIND_BITS) - 1)<<CV_SEQ_ELTYPE_BITS) 1<<2 -1 << 12 3 <<1100 = 1100000 = 2^6+2^5
01458 #define CV_SEQ_ELTYPE_BITS 12
01478 #define CV_SEQ_KIND_CURVE (1 << CV_SEQ_ELTYPE_BITS)
01534 #define CV_IS_SEQ_POINT_SET( seq ) \ 01535 ((CV_SEQ_ELTYPE(seq) == CV_32SC2 || CV_SEQ_ELTYPE(seq) == CV_32FC2))
#define CV_SEQ_ELTYPE( seq ) ((seq)->flags & CV_SEQ_ELTYPE_MASK)