chessboard
int n_cols = 4; // 角点行的个数int n_rows = 6; //角点列的个数int n_pix = 100; //每一个块的像素int col = n_pix * (n_cols + 1); // 生成标定图的列int row = n_pix * (n_rows + 1); //生成标定图的行Mat map = Mat(row, col, CV_8UC1, Scalar::all(0)); //初始化将所有的像素设为0for (int i = 0; i < row; i++) { // 遍历所有像素点for (int j = 0; j < col; j++) {if (int(i / n_pix) % 2 == 0) { //如果是奇数行if (int(j / n_pix) % 2 != 0) {map.at<Vec3b>(i, j)[0] = 255;map.at<Vec3b>(i, j)[1] = 255;map.at<Vec3b>(i, j)[2] = 255;}}if (int(i / n_pix) % 2 != 0) { //如果是偶数行if (int(j / n_pix) % 2 == 0) {map.at<Vec3b>(i, j)[0] = 255;map.at<Vec3b>(i, j)[1] = 255;map.at<Vec3b>(i, j)[2] = 255;}}}}imshow("1", map);waitKey();
chessboard相关推荐
- UESTC 1851 Kings on a Chessboard
状压DP... Kings on a Chessboard Time Limit: 10000ms Memory Limit: 65535KB This problem will be judged ...
- Numbers on the Chessboard
You are given a chessboard of size n×nn×n. It is filled with numbers from 11 to n2n2 in the followin ...
- [poj2446]Chessboard
Description 给定一个m×n的棋盘,上面有k个洞,求是否能在不重复覆盖且不覆盖到洞的情况下,用2×1的卡片完全覆盖棋盘. Input 第一行有三个整数n,m,k(0<m,n<=3 ...
- 【CodeForces - 1027B 】Numbers on the Chessboard (没有营养的找规律题,无聊题)
题干: You are given a chessboard of size n×nn×n. It is filled with numbers from 11 to n2n2 in the foll ...
- Numbers on the Chessboard(CF-1027B)
Problem Description You are given a chessboard of size n×n. It is filled with numbers from 1 to n^2 ...
- Codewars-The wheat/rice and chessboard problem(棋盘放谷粒)
棋盘放谷粒 科学作家大卫·布拉特纳说,从前,有一个骗子为高端客户制作棋盘--在这个例子中,他是一个国王. 工匠很好;他的棋盘不仅仅是漂亮.他知道,国王喜欢下棋.于是他想出一个计谋,骗国王交出一大笔财产 ...
- LightOJ1171 Knights in Chessboard (II)(二分图最大点独立集)
题目 Source http://www.lightoj.com/volume_showproblem.php?problem=1171 Description Given an m x n ches ...
- UVA10284 POJ2512 Chessboard in FEN【国际象棋】
In the FEN (Forsyth-Edwards Notation), a chessboard is described as follows: • The Board-Content is ...
- UVA10751 Chessboard【数学水题】
A king wishes to go for a walk of a square chessboard with the following conditions: • Each two cons ...
- POJ1657 Bailian1657 Distance on Chessboard【基础】
Distance on Chessboard 描述 国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间.如下图所示: 王.后.车.象的走子规则如下: 王:横.直.斜都可以走,但每步限走一格. ...
最新文章
- 其中:ping.netstat,tracert 是最关键的三个.每年都有!~
- Windows11——Modern Standby(现代待机) S0改Suspend to RAM(待机到内存)S3睡眠解决方案
- 苹果Xcode帮助文档阅读指南
- 【Redis学习】Redis的安装、管理、适用场合以及使用
- bootstrap拖动div_JS组件系列——Bootstrap Table 表格行拖拽(二:多行拖拽)
- 近期要养成的学习习惯
- SCCM2007系列教程之九SCCM站点备份和恢复
- 第 45 届国际大学生程序设计竞赛(ICPC)亚洲区域赛(昆明),签到题HIL
- 逢看必会的三子棋小游戏:原来可以这么简单
- 小 Mil 来了!Milvus 智能问答机器人上线
- ecshop与shopex哪个更好?
- 测试自己移动速度的软件,鼠标灵敏度测试检测工具 测试鼠标的灵敏度与移动速度...
- 三位数的茎叶图怎么看_如何看懂茎叶图
- 科技对金融业的告白信,有百融云创的落款
- 关于前几天的招聘,我说几点
- javascript购物车实现详细代码讲解
- 批处理bat 延时启动的方法
- Java中tif转png,tif格式图片转换为gif、png、jpg格式(Java实战)
- 【k8s】kubectl label命令(对node添加、删除label)
- 光伏多峰最大功率点跟踪MPPT MATLAB/Simulink仿真模型