1.绘制直线
cv.line(img,start,end,color,thickness)
参数:img:要绘制直线的图像
Start,end:直线的起点和终点
color:线条的颜色
Thickness:线条宽度
2.绘制圆形
cv.circle(img,centerpoint,r,color,thickness)
参数:img:要绘制圆形的图像
Centerpoint,r:圆心和半径
Color:线条的颜色
Thickness:线条宽度,为-1时生成闭合图案并填充颜色
3.绘制矩形
cv.rectangle(img,leftupper,rightdown,color,thickness)
参数:img:要绘制矩形的图像
Leftupper,rightdown:矩形的左上角和右下角坐标
Color:线条的颜色
Thickness:线条的宽度
4.向图像中添加文字
cv.putText(img,text,station,font,fontsize,color,thickness,cv.LINE_AA)
参数:img:图像
Text:要写入的文本数据
Station:文本的放置位置
Font:字体
Fontsize:字体大小
5.代码展示: