Opencv Drawing Functions

Drawing Functions


https://docs.opencv.org/3.0-beta/modules/imgproc/doc/drawing_functions.html

header for Drawing functions: imgproc.hpp


Mat image(200, 200, CV_8UC3, Scalar(0));
RotatedRect rRect = RotatedRect(Point2f(100, 100), Size2f(100, 50), 30);

Point2f vertices[4];
rRect.points(vertices);
for (int i = 0; i < 4; i++)
line(image, vertices[i], vertices[(i + 1) % 4], Scalar(0, 255, 0),1);

Rect brect = rRect.boundingRect();
rectangle(image, brect, Scalar(255, 0, 0));

imshow("rectangles", image);
waitKey(0);



Comments

Popular posts from this blog

OpenCV Programming 1