标签:ring ram params tle size otto ppt keyword class
线段:line 函数
void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineT ype=8, int shift=0);
// 绘制线
void DrawLine(Mat img, Point start, Point end){
int thickness = 2;
int lineType = 8;
line(img, start, end, Scalar(0, 0, 0), thickness, lineType);
}
void ellipse(Mat& img, Point center, Size axes,double angle, double startAngle, double endAngle, const Scalar& color, int thickness=1,int lineType=8, int shift=0);
//绘制不同角度。相同尺寸的椭圆
void DrawEllipse(Mat img, double angle){
int thickness = 2;
int lineType = 8;
ellipse(img, Point(wwidth / 2, wwidth / 2),Size(wwidth / 4, wwidth / 16), angle,0, 360, Scalar(255, 129, 0), thickness, lineType);
}
void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0);
//绘制矩形
rectangle(rookImage, Point(0, 7 * wwidth),Point(wwidth, wwidth), Scalar(0, 255, 255), -1, 8);
void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0);
//绘制实心圆
void DrawFilledCircle(Mat img, Point center){
int thickness = -1; //线粗
int lineType = 8;
circle(img, center, wwidth / 32, Scalar(0, 0, 255),thickness, lineType);
}
void fillPoly(Mat& img, const Point** pts,const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() );
//实现凹多边形绘制
void DrawPolygon(Mat img){
int lineType = 8;
//创建一些点
Point rootPoints[1][20];
rootPoints[0][0] = Point(wwidth / 4, 7 * wwidth / 8);
rootPoints[0][1] = Point(3 * wwidth / 4, 7 * wwidth / 8);
rootPoints[0][2] = Point(3 * wwidth / 4, 13 * wwidth / 16);
rootPoints[0][3] = Point(11 * wwidth / 16, 13 * wwidth / 16);
rootPoints[0][4] = Point(19 * wwidth / 32, 3 * wwidth / 8);
rootPoints[0][5] = Point(3 * wwidth / 4, 3 * wwidth / 8);
rootPoints[0][6] = Point(3 * wwidth / 4, wwidth / 8);
rootPoints[0][7] = Point(26 * wwidth / 40, wwidth / 8);
rootPoints[0][8] = Point(26 * wwidth / 40, wwidth / 4);
rootPoints[0][9] = Point(22 * wwidth / 40, wwidth / 4);
rootPoints[0][10] = Point(22 * wwidth / 40, wwidth / 8);
rootPoints[0][11] = Point(18 * wwidth / 40, wwidth / 8);
rootPoints[0][12] = Point(18 * wwidth / 40, wwidth / 4);
rootPoints[0][13] = Point(14 * wwidth / 40, wwidth / 4);
rootPoints[0][14] = Point(14 * wwidth / 40, wwidth / 8);
rootPoints[0][15] = Point(wwidth / 4, wwidth / 8);
rootPoints[0][16] = Point(wwidth / 4, 3 * wwidth / 8);
rootPoints[0][17] = Point(13 * wwidth / 32, 3 * wwidth / 8);
rootPoints[0][18] = Point(5 * wwidth / 16, 13 * wwidth / 16);
rootPoints[0][19] = Point(wwidth / 4, 13 * wwidth / 16);
const Point* ppt[1] = { rootPoints[0] };
int npt[] = { 20 };
fillPoly(img, ppt, npt, 1, Scalar(255, 255, 255), lineType);
}
void putText(Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
putText(Image, "OpenCv", Point(width / 2, width / 2), FONT_HERSHEY_PLAIN, 1, Scalar(255, 255, 255), 1, 8, false);
借鉴博客:https://www.cnblogs.com/ishero/p/11136315.html
标签:ring ram params tle size otto ppt keyword class
原文地址:https://www.cnblogs.com/bjxqmy/p/12225743.html