从二值图像中检索轮廓,并返回检测到的轮廓的个数。
first_contour的值由函数填充返回,它的值将为第一个外轮廓的 指针,当没有轮廓被检测到时为NULL。其它轮廓可以使用h_next和v_next连接,从first_contour到达。
用法:
int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,int header_size=sizeof(CvContour), int mode=CV_RETR_LIST,int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0,0) );
image:要处理的 二值图像
storage:返回轮廓的容器
first_contour:指向第一个外接轮廓
header_size:
mode:检测模式:
first_contour的值由函数填充返回,它的值将为第一个外轮廓的 指针,当没有轮廓被检测到时为NULL。其它轮廓可以使用h_next和v_next连接,从first_contour到达。
用法:
int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,int header_size=sizeof(CvContour), int mode=CV_RETR_LIST,int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0,0) );
image:要处理的 二值图像
storage:返回轮廓的容器
first_contour:指向第一个外接轮廓
header_size:
mode:检测模式:
CV_RETR_EXTERNAL:只检索最外面的轮廓;
CV_RETR_LIST:检索所有的轮廓,并将其放入list中;
CV_RETR_CCOMP:检索所有的轮廓,并将他们组织为两层: