#include<opencv2/core.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgproc.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main()
{
Mat src=Mat::zeros(1080,1080,CV_8UC3);//创建一张空白图像
putText(src,"hello",Point(200,270),FONT_HERSHEY_SIMPLEX,3,Scalar(255,255,255),4,8);//在空白图像上显示文字
circle(src,Point(100,100),100,Scalar(25,0,255),3,8);//在空白图像上画圆形
line(src,Point(0,1000),Point(1000,0),Scalar(255,0,55),2,8);//在空白图像上画线
rectangle(src,Point(src.rows/2,src.cols/2),Point(700,700),Scalar(0,255,5),8);//在空白图像上画矩形
ellipse(src,Point(700,700),Size(150,300),-45,0,360,Scalar(200,200,200),3,8);//在空白图像上画椭圆形
imshow("画图",src);
waitKey(0);
return 0;
}
下面放效果图: