只用来记录学习笔记
1 划线:
void MyLine() {
Point p1 = Point(20, 30);
Point p2;
p2.x = 400;
p2.y = 400;
Scalar color = Scalar(0, 0, 255);
line(src, p1, p2, color, 1, LINE_8);
}
line函数参数: Mat,起始点,终点,颜色,粗细,8联通线
2 划矩形:
void MyRectangle() {
Rect rect = Rect(10, 10,100, 100); //x,y,width,height
Scalar color = Scalar(255, 0, 0);
rectangle(src, rect, color, 2, LINE_8);
}
rectangle函数参数: Mat,Rect,颜色,粗细,8联通线
3. 划椭圆: