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;
}
相关推荐
小陈又菜1 小时前
【C++】类和对象--类中6个默认成员函数(2) --运算符重载
开发语言·c++·运算符重载
weixin_307779134 小时前
C++实现MATLAB矩阵计算程序
开发语言·c++·算法·matlab·矩阵
捏尼卜波卜4 小时前
try/catch/throw 简明指南
linux·开发语言·c++
_poplar_5 小时前
09 【C++ 初阶】C/C++内存管理
c语言·开发语言·数据结构·c++·git·算法·stl
GetcharZp5 小时前
C++ Boost 从入门到精通:让你的代码飞起来
c++·后端
mit6.8246 小时前
[LVGL] 配置lv_conf.h | 条件编译 | 显示屏lv_display
c++·mfc
板鸭〈小号〉6 小时前
线程安全的单例模式,STL和智能指针
开发语言·c++·单例模式
阿飞__6 小时前
C++使用FFmpeg进行视频推流
c++·ffmpeg·音视频
limitless_peter7 小时前
优先队列,链表优化
c++·算法·链表
新手村领路人8 小时前
c++ opencv调用yolo onnx文件
c++·opencv·yolo