![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/60145d8ef554973d12159c7c6ff5568a.png)
#include<opencv2/opencv.hpp>
#include<opencv2/xfeatures2d.hpp>
#include<iostream>
using namespace cv;
using namespace cv::xfeatures2d;
using namespace std;
Mat draw();
int main()
{
Mat image = draw();
imshow("xx",image);
waitKey(0);
return 0;
}
Mat draw()
{
Mat chessmap(Size(400, 400), CV_8UC1);
for (int i = 0; i < chessmap.rows; i++)
{
for (int j = 0; j < chessmap.cols; j++)
{
if ((i / 40) % 2 == (j / 40) % 2) chessmap.at<uchar>(j, i) = 0;
else chessmap.at<uchar>(j, i) = 255;
}
}
return chessmap;
}