美文网首页
图形函数

图形函数

作者: 轻歌若雪 | 来源:发表于2018-02-07 18:25 被阅读0次

    line()

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

    The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.


    circle()

    void circle( InputOutputArray _img, Point center, int radius,
                 const Scalar& color, int thickness, int line_type, int shift )
    

    The function circle draws a simple or filled circle with a given center and radius.
    @param thickness Thickness of the circle outline, if positive. Negative thickness means that a filled circle is to be drawn.


    rectangle()

    void rectangle(InputOutputArray img, Point pt1, Point pt2,
                              const Scalar& color, int thickness = 1,
                              int lineType = LINE_8, int shift = 0);
    

    @param pt1 Vertex of the rectangle.
    @param pt2 Vertex of the rectangle opposite to pt1 .

    void rectangle(CV_IN_OUT Mat& img, Rect rec,
                              const Scalar& color, int thickness = 1,
                              int lineType = LINE_8, int shift = 0);
    

    use rec parameter as alternative specification of the drawn rectangle: r.tl() and r.br()-Point(1,1) are opposite corners


    ellipse()

    void ellipse(InputOutputArray img, Point center, Size axes,
                            double angle, double startAngle, double endAngle,
                            const Scalar& color, int thickness = 1,
                            int lineType = LINE_8, int shift = 0);
    

    @param center Center of the ellipse.
    @param axes Half of the size of the ellipse main axes.
    @param angle Ellipse rotation angle in degrees.
    @param startAngle Starting angle of the elliptic arc in degrees.
    @param endAngle Ending angle of the elliptic arc in degrees.

    angle参数为整个椭圆的角度
    startAngle、endAngle为始末位置

    void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
                            int thickness = 1, int lineType = LINE_8);
    

    @param box Alternative ellipse representation via RotatedRect. This means that the function draws
    an ellipse inscribed in the rotated rectangle.


    polyline()

    void polylines(InputOutputArray img, InputArrayOfArrays pts,
                                bool isClosed, const Scalar& color,
                                int thickness = 1, int lineType = LINE_8, int shift = 0 );
    
    void polylines(Mat& img, const Point* const* pts, const int* npts,
                              int ncontours, bool isClosed, const Scalar& color,
                              int thickness = 1, int lineType = LINE_8, int shift = 0 );
    

    @param pts Array of polygonal curves.
    @param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
    the function draws a line from the last vertex of each curve to its first vertex.


    LineTypes:

    enum LineTypes {
        FILLED  = -1,
        LINE_4  = 4, //!< 4-connected line
        LINE_8  = 8, //!< 8-connected line
        LINE_AA = 16 //!< antialiased line
    };
    

    相关文章

      网友评论

          本文标题:图形函数

          本文链接:https://www.haomeiwen.com/subject/wnanzxtx.html