c++代码生成标定板

复制代码
#include <opencv.hpp>
#include "highgui.h"
#include "cxcore.h"

using namespace cv;

int main0(int argc, char *argv[])
{
    int width = 140;//width and heigth of single square
    int height = 140;
        IplImage *src = cvCreateImage(cvSize(width*(10+1),width*(6+1)), IPL_DEPTH_8U, 1);//in the CalibrationAndTest.cpp ,there is a param called boardsize(10,6), causing here:(10+1),(6+1)
        cvZero(src);
        for (int i = 0; i < src->height; i++)
        {
            for (int j = 0; j < src->width; j++)
            {
                if ((i / width + j / height) % 2 != 0)
                {
                    src->imageData[i*src->widthStep + j * src->nChannels] = 255;
                }
            }
        }

        //cvNamedWindow("src");
        cvShowImage("src", src);

        //cvSaveImage("ChessBoard.bmp", src, 0);
        cvWaitKey(0);

        return 0;
}
相关推荐
郭涤生21 小时前
布隆过滤器
c++
智者知已应修善业1 天前
【求中位数】2024-1-23
c语言·c++·经验分享·笔记·算法
9ilk1 天前
【C++】--- 特殊类设计
开发语言·c++·后端
程序员zgh1 天前
Linux系统常用命令集合
linux·运维·服务器·c语言·开发语言·c++
獭.獭.1 天前
C++ -- STL【unordered_set与unordered_map的实现】
开发语言·c++·unordered_map·unordered_set
qq_433554541 天前
C++数位DP
c++·算法·图论
似水এ᭄往昔1 天前
【C++】--AVL树的认识和实现
开发语言·数据结构·c++·算法·stl
程序员zgh1 天前
常用通信协议介绍(CAN、RS232、RS485、IIC、SPI、TCP/IP)
c语言·网络·c++
暗然而日章1 天前
C++基础:Stanford CS106L学习笔记 8 继承
c++·笔记·学习
有点。1 天前
C++ ⼀级 2023 年06 ⽉
开发语言·c++