cvPolyLine与cvFillPoly的用法
来源:互联网 发布:数据库exists和in 编辑:程序博客网 时间:2024/05/18 03:36
1、cvPolyLine 绘制简单或多样的多边形。
void cvPolyLine( CvArr* img, CvPoint** pts, int* npts, int contours, int is_closed,
CvScalar color, int thickness=1, int line_type=8, int shift=0 );
img 图像。
pts 折线的顶点指针数组。
npts 折线的定点个数数组。也可以认为是pts指针数组的大小
contours 折线的线段数量。
is_closed 指出多边形是否封闭。如果封闭,函数将起始点和结束点连线。
color 折线的颜色。
thickness 线条的粗细程度。
line_type 线段的类型。参见cvLine。
shift 顶点的小数点位数。
void cvPolyLine( CvArr* img, CvPoint** pts, int* npts, int contours, int is_closed,
img
pts
npts
contours
is_closed
color
thickness
line_type
shift
2、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 顶点坐标的小数点位数。
img
pts
npts
contours
color
line_type
shift
#include "stdafx.h"
- #include
"cv.h" - #include
"highgui.h" - int
main(int argc, char* argv[]) - {
- char
wndname[] = "Drawing Demo"; - cvNamedWindow(wndname);
- int
arr[1]; - arr[0]
= 4; - CvPoint
** pt = new CvPoint*[1]; - pt[0]
= new CvPoint[4]; - pt[0][0]
= cvPoint(0,0); - pt[0][1]
= cvPoint(100,10); - pt[0][2]
= cvPoint(30,60); - pt[0][3]
= cvPoint(10,100); - IplImage*
image = cvCreateImage( cvSize(200,200), 8, 3 ); - cvPolyLine(
image, pt, arr, 1, 1, CV_RGB(250,0,0)); - cvFillPoly(image,pt,arr,1,CV_RGB(250,0,0));
- cvShowImage(wndname,image);
- cvWaitKey(1000000);
- return
0; - }
- cvPolyLine与cvFillPoly的用法
- cvPolyLine与cvFillPoly的用法
- cvPolyLine与cvFillPoly的用法
- cvPolyLine与cvFillPoly的用法
- cvPolyLine与cvFillPoly的用法
- cvFillConvexPoly cvFillPoly cvPolyLine
- OpenCV绘图之多边形函数cvFillPoly,cvPolyLine,cvFillConvexPoly
- opencv 绘图 cvLine cvRectangle cvCircle cvEllipse cvEllipseBox cvFillPoly cvConvexPoly cvPolyLine
- OpenCV学习笔记之十 (cvFillPoly&cvPolyLine)
- cvPolyLine
- cvFillPoly
- cvFillPoly()函数使用
- OpenCV画多边形cvPolyLine
- <与>的用法
- 与的小用法
- &位与的用法
- linux ` ` 与 $()的用法
- 引用“ & " 的用法 与 指针的用法
- 三十七、类别 和 协议(一)类别
- 三十八、类别 和 协议(二)关于 类别
- 木偶娃娃的伤感日志推荐:只是一场赢不了的游戏
- hdu 1251统计难题
- Thumb指令与ARM指令的时间效率和空间效率关系
- cvPolyLine与cvFillPoly的用法
- 三十九、类别 和 协议(三)协议
- sprintf
- android:shape的使用
- 浅析android UI 定制
- 2.2、线性表的顺序表示和实现
- 四十、类别 和 协议(四)协议
- Kinect 深度测量原理
- 解决Oracle ORA-12505, TNS:listener does not currently know of SID given in connect