OpenCV绘制 线 矩形 圆 椭圆

line(src,Point(10.10),Point(100.100),Scalar(0,0,255),1,LINE_8)
//绘制矩形
    Rect rect(100, 100, 200, 200);
    RNG rng(12345);
    Scalar scalar(rng.uniform(0, 256), rng.uniform(0, 256), rng.uniform(0, 256));
    rectangle(src, rect, scalar, 1, 8);
//绘制圆
    circle(src, Point(200, 200), 100, scalar, -1, 8);

 

//绘制椭圆
    RotatedRect rrt;
    rrt.center = Point2f(256, 256);
    rrt.angle = 45;
    rrt.size = Size(100, 200);
    ellipse(src, rrt, scalar, -1, 8);

你可能感兴趣的:(OpenCV,opencv,人工智能,计算机视觉)