zoukankan      html  css  js  c++  java
  • opencv rectangle

    opencv   rectangle

    void rectangle( InputOutputArray _img, Point pt1, Point pt2,
                    const Scalar& color, int thickness,
                    int lineType, int shift )
    {
        CV_INSTRUMENT_REGION();
    
        Mat img = _img.getMat();
    
        if( lineType == CV_AA && img.depth() != CV_8U )
            lineType = 8;
    
        CV_Assert( thickness <= MAX_THICKNESS );
        CV_Assert( 0 <= shift && shift <= XY_SHIFT );
    
        double buf[4];
        scalarToRawData(color, buf, img.type(), 0);
    
        Point2l pt[4];
    
        pt[0] = pt1;
        pt[1].x = pt2.x;
        pt[1].y = pt1.y;
        pt[2] = pt2;
        pt[3].x = pt1.x;
        pt[3].y = pt2.y;
    
        if( thickness >= 0 )
            PolyLine( img, pt, 4, true, buf, thickness, lineType, shift );
        else
            FillConvexPoly( img, pt, 4, buf, lineType, shift );
    }
    void rectangle( InputOutputArray img, Rect rec,
                    const Scalar& color, int thickness,
                    int lineType, int shift )
    {
        CV_INSTRUMENT_REGION();
    
        if( !rec.empty() )
            rectangle( img, rec.tl(), rec.br() - Point(1<<shift,1<<shift),
                       color, thickness, lineType, shift );
    }

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

    QQ 3087438119
  • 相关阅读:
    【CF833E】Caramel Clouds
    【LG2183】[国家集训队]礼物
    (ex)Lucas总结
    【CF527C】Glass Carving
    【CF833D】Red-Black Cobweb
    【LG4631】[APIO2018]Circle selection 选圆圈
    volatile梳理
    ThreadLocal梳理
    java线程基础梳理
    TCP/IP
  • 原文地址:https://www.cnblogs.com/herd/p/15413905.html
Copyright © 2011-2022 走看看