在opencv的sample中有相机标定的例程(calibration.cpp)
通过新建项目,选择添加“现有项”,便可以将原始代码添加进入当前方案的原文件中,然后点击【生成】->【重新生成解决方案】获取可执行文件.exe完成对程序的创建。
面对opecv里面的例程,我们一开始都不知道应该要输入什么参数,因此可以通过查看程序文档来了解程序的使用,在opencv自带的例程中,几乎都含有一个名为help()的函数用来介绍函数的功能和如何运行该程序,因此我们首先要先找到程序里面的help()函数。相机标定例程中的help()函数如下:
static void help()
{
printf( "This is a camera calibration sample.\n"
"Usage: calibration\n"
" -w=<board_width> # the number of inner corners per one of board dimension\n"
" -h=<board_height> # the number of inner corners per another board dimension\n"
" [-pt=<pattern>] # the type of pattern: chessboard or circles' grid\n"
" [-n=<number_of_frames>] # the number of frames to use for calibration\n"
" # (if not specified, it will be set to the number\n"
" # of board views actually available)\n"
" [-d=<delay>] # a minimum delay in ms between subsequent attempts to capture a next view\n"
" # (used only for video capturing)\n"
" [-s=<squareSize>] # square size in some user-defined units (1 by default)\n"
" [-o=<out_camera_params>] # the output filename for intrinsic [and extrinsic] parameters\n"
"