The function cv::line() draws a straight line from pt1 to pt2 in the image img. Lines are
automatically clipped by the image boundaries.
cv::rectangle()
void rectangle(
cv::Mat& img, // Image to be drawn on
cv::Point pt1, // First corner of rectangle
cv::Point pt2 // Opposite corner of rectangle
const cv::Scalar& color, // Color, BGR form
int lineType = 8, // Connectedness, 4 or 8
int shift = 0 // Bits of radius to treat as fraction
);
void rectangle(
cv::Mat& img, // Image to be drawn on
cv::Rect r, // Rectangle to draw
const cv::Scalar& color, // Color, BGR form
int lineType = 8, // Connectedness, 4 or 8
int shift = 0 // Bits of radius to treat as fraction
);
The function cv::rectangle() draws a rectangle with corners pt1 to pt2 in the image img. An
alternate form of cv::rectangle() allows the rectangle’s location and size to be specified by a single
cv::Rect argument r.
cv::polyLines()
void polyLines(
cv::Mat& img, // Image to be drawn on
const cv::Point* pts, // C-style array of arrays of points
int npts, // Number of points in ‘pts[i]’
int ncontours, // Number of arrays in ‘pts’
bool isClosed, // If true, connect last and first points
const cv::Scalar& color, // Color, BGR form
int lineType = 8, // Connectedness, 4 or 8
int shift = 0 // Bits of radius to treat as fraction
);
This function draws any number of unfilled ...