Drawing functions
(1) Linear cvline function
Its structure
void Cvline (//Draw line
cvarr* array,//canvas image
cvpoint pt1,//start point
cvpoint pt2,//end
cvscalar color,//color
int thickness = 1,//width
int connectivity = 8//anti-aliasing
);
Instance Code
#include <cv.h>
#include
Output results
(2) Rectangle Cvrectangle function
Its structure
void Cvrectangle (//Draw rectangle
cvarr* array,//canvas graphics
cvpoint pt1,//start point cvpoint
pt2,//end
cvscalar color,//Color
int thickness = 1,//width
);
Instance Code
#include <cv.h>
#include
Output results
(3) Circular cvcircle function
Its structure
void Cvcircle (//Draw circle
cvarr* array,//canvas image
cvpoint cevter,//Center
int radius,//radius
cvscalar color,//Color
int thickness = 1,//width
int connectivity = 8//anti-aliasing
);
Instance Code
#include <cv.h>
#include
Output results
(4) Elliptic cvellipse function
Its structure
void Cvellipse (//Draw ellipse
cvarr* img,//canvas image
cvpoint center,//center point cvsize axes,//Long and short
axis
double angle,//deviate from spindle angle
Double start_angle,//arc start position
Double end_angle,//arc End position
cvscalar color,//color
int thickness = 1,//width
int line_type = 8//
);
Instance Code
#include <cv.h>
#include
Output results
(5) Polygon function
1.cvFillPoly function
Its structure
void Cvfillpoly (//Draw multiple solid polygons
cvarr* img,//canvas image
cvpoint** pts,//point sequence
int* npt,//count points array
int contours,// Display several polygons
cvscalar color,//color
int line_type = 8
);
2.cvFillConvexPoly function
Its structure
void Cvfillconvexpoly (//Draw a solid polygon
cvarr* img,//canvas image
cvpoint* pts,//point sequence
int npt,//count points array
cvscalar color,//color
int line_type = 8
);
3.cvPolyLine function
void Cvfillpoly (//Draw multiple hollow polygons
cvarr* img,//canvas image
cvpoint** pts,//point sequence
int* npt,//count points array
int contours,// Shows whether several polygon
int is_closed,//start from the last polygon end point
cvscalar color,//color
int thickness = 1,//width
int line_type = 8
);
Instance Code
#include <cv.h> #include Output results
(6) Draw text Cvputtext function
Its structure
void Cvputtext (//Draw text
cvarr* img,//drawing image