#include <opencv2/opencv.hpp>
#include
using namespace cv;
using namespace std;
int main()
{
Mat src;
src = Mat();
src.create(300, 600, CV_8UC3);//A function to resize a window
Mat out(src.size(), src.type(), Scalar(255,255,255));//全白图
Rect rect(0, 0, 600, 300);//左上坐标(x,y)和矩形的长(x)宽(y)
cv::rectangle(src, rect, Scalar(255, 255, 255),-1, LINE_8,0);
cv::rectangle(src, Point(0, 120), Point(600, 180), Scalar(1, 33, 105), -1, LINE_8, 0);
cv::rectangle(src, Point(270, 0), Point(350, 300), Scalar(1, 33, 105), -1, LINE_8, 0);
int a=67,b=34;
Point p1(a,0);
Point p2(0,250);
Point p3(250,99);
std::vector<Point>pts1;
pts1.push_back(p1);
pts1.push_back(p2);
pts1.push_back(p3);
Point p4(350,0);
Point p5(600-a,250);
Point p6(350,99);
std::vector<Point>pts2;
pts2.push_back(p4);
pts2.push_back(p5);
pts2.push_back(p6);
Point p7(600,b);
Point p8(600,100);
Point p9(400+2*b,100);
std::vector<Point>pts3;
pts1.push_back(p7);
pts1.push_back(p8);
pts1.push_back(p9);
Point p10(400+2*b,200);
Point p11(600,200);
Point p12(600,300-b);
std::vector<Point>pts4;
pts1.push_back(p10);
pts1.push_back(p11);
pts1.push_back(p12);
Point p13(350,201);
Point p14(350,300);
Point p15(600-a,300);
std::vector<Point>pts5;
pts1.push_back(p13);
pts1.push_back(p14);
pts1.push_back(p15);
Point p16(250,201);
Point p17(250,300);
Point p18(1*a,300);
std::vector<Point>pts6;
pts1.push_back(p16);
pts1.push_back(p17);
pts1.push_back(p18);
Point p19(0,200);
Point p20(200-2*b,200);
Point p21(0,300-b);
std::vector<Point>pts7;
pts1.push_back(p19);
pts1.push_back(p20);
pts1.push_back(p21);
Point p22(0,1*b);
Point p23(0,100);
Point p24(200-2*b,100);
std::vector<Point>pts8;
pts1.push_back(p22);
pts1.push_back(p23);
pts1.push_back(p24);
std::vector<std::vector<Point>>contours;
contours.push_back(pts1);
contours.push_back(pts2);
contours.push_back(pts3);
contours.push_back(pts4);
contours.push_back(pts5);
contours.push_back(pts6);
contours.push_back(pts7);
contours.push_back(pts8);
drawContours(src,contours,-1,Scalar(0,255,0),-1);
imshow("src", src);
waitKey(0);
}