CvPoint curve1[]={10,10, 10,100, 100,100, 100,10};
CvPoint curve2[]={30,30, 30,130, 130,130, 130,30, 150,10};
CvPoint curve3[]={210,210, 210,300, 300,300, 300,210};
CvPoint* curveArr[3]={curve1, curve2,curve3};
int nCurvePts[3]={4,5,4};//每组各有几个点
int nCurves=3;//要画的曲线数
int isCurveClosed=1;
int lineWidth=1;
cvFillPoly(pImg,curveArr,nCurvePts,nCurves,cvScalar(0,255,255));
/*
cvFillPoly用于一个单独被多边形轮廓所限定的区域内进行填充。
函数可以填充复杂的区域,例如,有漏洞的区域和有交叉点的区域等等。
void cvFillPoly( CvArr* img,
CvPoint** pts, int* npts,
int contours,CvScalar color,
int line_type=8, int shift=0 );
img 图像。
pts 指向多边形的数组指针。
npts 多边形的顶点个数的数组。
contours 组成填充区域的线段的数量。
color 多边形的颜色。
line_type 组成多边形的线条的类型。
shift 顶点坐标的小数点位数。
*/
cvFillPoly
最新推荐文章于 2024-05-23 11:45:00 发布