您的位置:首页 > 大数据 > 人工智能

opencv 笔记06Core_Paint

2013-04-10 17:20 113 查看


  OpenCV 原理

本节中,我门将大量使用 Point 和 Scalar 这两个结构: 


  Point

表示了由其图像坐标 

 和 

 指定的2D点。可定义为:

Point pt;
pt.x = 10;
pt.y = 8;


或者

Point pt =  Point(10, 8);



S calar

表示了具有4个元素的数组。次类型在OpenCV中被大量用于传递像素值。第三、四个参数默认值为0

本节中,我们将进一步用它来表示RGB颜色值(三个参数)。如果用不到第四个参数,则无需定义。

我们来看个例子,如果给出以下颜色参数表达式:

Scalar( a, b, c )


那么定义的RGB颜色值为: Red = c, Green = b and Blue = a

void line(Mat& img,
Point pt1, Point pt2, const Scalar& color,
int thickness=1, int lineType=8, int shift=0)

void ellipse(Mat& img,
Point center, Size axes, double angle,
double startAngle, double endAngle, const
Scalar& color, intthickness=1, int lineType=8,
int shift=0)


更多:
http://opencv.willowgarage.com/documentation/cpp/core_drawing_functions.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  OpenCV core