I want to draw a rectangle in OpenCV by using this function:
rectangle(Mat& img, Rect rec, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
But when I use it I am facing some errors. My question is: can anyone explain the function with an example? I found some examples but with another function:
rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
This example on the second function:
rectangle(image, pt2, pt1, Scalar(0, 255, 0), 2, 8, 0);
This function I understand, but with the first function I'm facing a problem in parameter Rect
. I don't know how I can deadlier it?