opencv 笔记06Core_Paint

来源:互联网 发布:企业电话搜索软件 编辑:程序博客网 时间:2024/06/06 12:27

  OpenCV 原理

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

  Point

表示了由其图像坐标 x 和 y 指定的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 = cGreen = 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)_images/ellipse.png

    更多:

    http://opencv.willowgarage.com/documentation/cpp/core_drawing_functions.html


原创粉丝点击