OpenCV 原理
本节中,我门将大量使用 Point 和 Scalar 这两个结构:
Point
表示了由其图像坐标
和
指定的2D点。可定义为:
或者
S calar
-
表示了具有4个元素的数组。次类型在OpenCV中被大量用于传递像素值。第三、四个参数默认值为0
-
本节中,我们将进一步用它来表示RGB颜色值(三个参数)。如果用不到第四个参数,则无需定义。
-
我们来看个例子,如果给出以下颜色参数表达式:
那么定义的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