void QuickDemo::drawing_demo(Mat& image) {
Rect rect;
rect.x = 100;
rect.y = 100;
rect.width = 250;
rect.height = 300;
Mat bg = Mat::zeros(image.size(), image.type());
rectangle(bg, rect, Scalar(0, 0, 255), -1, 8, 0);
circle(image, Point(350, 400), 15, Scalar(255, 0, 0), -1, 8, 0);
line(bg, Point(100, 100), Point(350, 400), Scalar(0, 255, 0), 4, LINE_AA, 0);
RotatedRect rrt;
rrt.center = Point(200, 200);
rrt.size = Size(100, 200);
rrt.angle = 90.0;
ellipse(bg, rrt, Scalar(0, 255, 255), 2, 8);
Mat dst;
addWeighted(image, 0.9, bg, 0.3, 0, dst);
imshow("矩形", bg);
}
opencv14-图像几何形状绘制
最新推荐文章于 2024-08-16 15:27:00 发布