OCamCalib软件的使用方法
标签:相机标定
转载请说明:http://blog.csdn.net/hust_sheng/article/details/77976619
此软件方便易用,且精度高于OpenCV等普通工具,是相机去畸变的常用工具。详细见官网(可能需要翻墙)。
-
matlab进入对应目录
比如C:\Users\popsheng\Desktop\Scaramuzza_OCamCalib_v3.0_win
- 输入ocam_calib
打开下面的界面
- 输入ocam_calib
-
拍照要求
ATTENTION!
In order to obtain good calibration results, I suggest the following:- Approach the checkerboard to the mirror or to the fisheye as much as you can (see sample images below). This will improve the calibration and will increase the chances that the Automatic Checkerboard Extraction tool finds all the corners! Make sure that every corner of the checkerboard is visible in each image. For the Automatic Checkerboard Extraction tool it is furthermore important that a white border is present around the pattern.
- Take pictures of the checkerboard in order to cover all the visible area of the camera, e.g. from all around the mirror. By doing this, you allow calibration to compensate for possible misalignments between the camera and mirrors axes. The second and most important reason for doing this is that it helps the automatic detection of the center of the omnidirectional image.
-
Load images
Before loading the images, make sure that they are in the same folder of the toolbox files.(Copy all the images into OCamCalib folder) -
click on the button
Read names
-
会提示:
Basename camera calibration images (without number nor suffix):
比如图片文件名是image1.jpg、image2.jpg… 这一步我们就输入image -
接下来会提示:
Image format: ([]='r'='ras', 'b'='bmp', 't'='tif', 'g'='gif', 'p'='pgm', 'j'='jpg', 'm'='ppm') >> g
告诉我们指示文件类型
-
-
Extraction of grid corners
-
会提示:
Extraction of the grid corners on the images Type the images you want to process (e.g. [1 2 3], [] = all images) =
即我们可以选择处理那几张图片,直接回车表示处理全部图片 -
接下来会提示:
Number of squares along the X direction ([]=10) =
以及Number of squares along the Y direction ([]=10) =
表示棋盘角点的个数,如果我们使用官网的棋盘,那么X就是6,Y就是8
-
接下来会提示:
Size dX of each square along the X direction ([]=30mm) =
以及Size dX of each square along the Y direction ([]=30mm) =
棋盘方格宽度,可以点击回车 -
接下来会提示:
X coordinate (along height) of the omnidirectional image center = ([]=960) =
以及Y coordinate (along width) of the omnidirectional image center = ([]=1280) =
用于指定图像中心点坐标,可以直接回车,软件默认使用(height/2, width/2), -
接下来是:
EXTRACTION OF THE GRID CORNERS Do you want to use the automatic image selection or do you want to process the images individually ( [] = automatic, other = individual )?
这一步表示我们可以选择处理某些图片,回车表示自动进行图像选择(忽略角点遮挡的图像),也是推荐的做法,回车即可
软件会一次处理每张图片,即找到棋盘格角点,如下图所示:
-
-
lick on the button
Calibration
-
会提示:
Degree of polynomial expansion ([]=4) =
即去除畸变的多项式展开度(幂值),默认值即可,直接回车
-
-
Find center
软件会依次迭代查找每个图像的中心并计算输出
Iteration 1...2...3...4...5...6...7...8...9...
...
Note, if at any time you would like to modify the coordinates of the center, you can simply modify the value of the variables ocam_model.xc and ocam_model.yc, which respectively contain row and column of the center location.
-
Calibration Refinement
非线性迭代估计相机内外参数,这一步我们可以设置迭代次数,还可以在处理的过程中点击回车停止迭代:
This function alternately refines EXTRINSIC and INTRINSIC calibration parameters by using a non linear minimization method Because of the computations involved this refinement can take some seconds Loop interrupting: Press enter to stop refinement. (OCamCalib GUI must be selected!) Maximum number of iterations ([] = 100, 0 = abort, -1 = no limit) =
-
Reproject on images
软件会根据估计的新校准参数重新投影所有格子角,且图像中心用红色圆圈进行了标注。 -
Show Extrinsic
软件会展示棋盘格的空间位置: -
Analyse error
可以查看所有棋盘的每个点的重新投影错误(畸变和正常的差)的分布。颜色指的是棋盘的不同图像:
-
Recompute corners
重新计算角点,提升准确率
- 会提示:
wintx ([] = 20) = winty ([] = 20) =
即容错窗口大小,回车默认即可
- 会提示:
-
Show Calib Results
展示校准结果:
-
Load, Save, and Export the calibration results
一次点击Save
Load
Export Data
即可,根目录下的calib_results.txt
就是我们需要的文件