绘制奥运五环

//使用Visual Studio编写

#include

using namespace cv;
int main()
{
Mat picture;
picture = Mat(1000, 1000, CV_8UC3,Scalar(255,255,255));//建立白底图片;
Point pt1(280, 400), pt3(500, 400), pt5(720, 400);
Point pt2(400, 500), pt4(620, 500);
circle(picture, pt1, 100, Scalar(255, 0, 0), 5, 4);//画蓝色圆
//circle ( img , center_point , radius , color , thickness , lineType)img:图片;center_point : 圆心;radius : 半径;长度;color : 颜色;thickness : 线宽;lineType : 线类型;


circle(picture, pt2, 100, Scalar(0, 255, 255), 5, 4);//画黄色圆
circle(picture, pt3, 100, Scalar(0, 0, 0), 5, 4);//画黑色圆
circle(picture, pt4, 100, Scalar(0, 255, 0), 5, 4);//画绿色圆
circle(picture, pt5, 100, Scalar(0, 0, 255), 5, 4);//画红色圆
imshow("奥运五环", picture);

waitKey(0);

}

运行结构如下:

绘制奥运五环_第1张图片


你可能感兴趣的:(绘图)