zoukankan      html  css  js  c++  java
  • opencv circle

    opencv circle

    /** @brief Draws a circle.
    
    The function circle draws a simple or filled circle with a given center and radius.
    @param img Image where the circle is drawn.
    @param center Center of the circle.
    @param radius Radius of the circle.
    @param color Circle color.
    @param thickness Thickness of the circle outline, if positive. Negative thickness means that a
    filled circle is to be drawn.
    @param lineType Type of the circle boundary. See the line description.
    @param shift Number of fractional bits in the coordinates of the center and in the radius value.
     */
    CV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius,
                           const Scalar& color, int thickness = 1,
                           int lineType = LINE_8, int shift = 0);
    void circle( InputOutputArray _img, Point center, int radius,
                 const Scalar& color, int thickness, int line_type, int shift )
    {
        CV_INSTRUMENT_REGION();
    
        Mat img = _img.getMat();
    
        if( line_type == CV_AA && img.depth() != CV_8U )
            line_type = 8;
    
        CV_Assert( radius >= 0 && thickness <= MAX_THICKNESS &&
            0 <= shift && shift <= XY_SHIFT );
    
        double buf[4];
        scalarToRawData(color, buf, img.type(), 0);
    
        if( thickness > 1 || line_type != LINE_8 || shift > 0 )
        {
            Point2l _center(center);
            int64 _radius(radius);
            _center.x <<= XY_SHIFT - shift;
            _center.y <<= XY_SHIFT - shift;
            _radius <<= XY_SHIFT - shift;
            EllipseEx( img, _center, Size2l(_radius, _radius),
                       0, 0, 360, buf, thickness, line_type );
        }
        else
            Circle( img, center, radius, buf, thickness < 0 );
    }

    ####################################

  • 相关阅读:
    网页布局——table布局
    Flex 布局——语法属性详解
    CSS实现垂直居中的几种方法
    svn:冲突(<<<<<<.mine ==== >>>>>>.xxxx)
    mysql:4种时间类型
    js:"use strict"; 严格模式
    js函数的Json写法
    spring 官方文档
    mybatis技术文章
    java:可变参数(转载)
  • 原文地址:https://www.cnblogs.com/herd/p/15410524.html
Copyright © 2011-2022 走看看