- Computation of extrinsic parameters only: Download an additional image of the same calibration grid:Image_ext.tif.
Notice that this image was not used in the main calibration procedure. The goal of this exercise is to compute the extrinsic parameters attached to this image given the intrinsic camera parameters previously computed.
注意这幅图片没有被主校正过程使用过。目标是,通过前面已经计算出的摄像机内部参数,计算出这幅图片对应的外部参数。
Click on Comp. Extrinsic in the Camera calibration tool, and successively enter the image name without extension (Image_ext), the image type (tif), and extract the grid corners (following the same procedure as previously presented - remember: the first clicked point is the origin of the pattern reference frame). The extrinsic parameters (3D location of the grid in the camera reference frame) is then computed. The main matlab window should look like:点击工具箱上的Comp.Extrinsic按钮,输入图片名字(不包括后缀,Image_ext),图片类型(tif),提取出角点(按照前面讲过的步骤,注意第一个点击的角点应该为坐标系原始点)。接下来,这幅图片的外部参数(在摄像机坐标系中的三维空间位置)被计算出来。matlab窗口显示如下:
The extrinsic parameters are encoded in the form of a rotation matrix (Rc_ext) and a translation vector (Tc_ext). The rotation vectoromc_ext is related to the rotation matrix (Rc_ext) through the Rodrigues formula:Rc_ext = rodrigues(omc_ext).
外部参数被保存在两个文件中:一个是旋转矩阵(Rc.ext),另一个是位移向量(Tc_ext)。旋转向量omc_ext与旋转矩阵相关:Rc_ext=rodrigues(omc_ext)。
Let us give the exact definition of the extrinsic parameters:让我们给出外部参数的具体定义:
Let P be a point space of coordinate vector XX = [X;Y;Z] in the grid reference frame(O,X,Y,Z) shown on the following figure:P点在网格坐标系中的位置:XX=[X;Y;Z]
Let XXc = [Xc;Yc;Zc] be the coordinate vector ofP in the camera reference frame (Oc,Xc,Yc,Zc).
P在摄像机坐标系中的位置:XXc = [Xc;Yc;Zc]
Then XX and XXc are related to each other through the following rigid motion equation:
这两个坐标系有以下的关系:
XXc = Rc_ext * XX + Tc_ext XXc = Rc_ext * XX + Tc_extIn addition to the rigid motion transformation parameters, the coordinates of the grid points in the grid reference frame are also stored in the matrixX_ext. Observe that the variablesRc_ext,Tc_ext, omc_ext andX_ext are not automatically saved into any matlab file.
作为对刚体运动转换参数的补充,网格坐标系的系数被存储在X_ext矩阵中。可以看到变量Rc_ext,Tc_ext和X_ext没有被自动保存在任何文件中。
Undistort images: This function helps you generate the undistorted version of one or multiple images given pre-computed intrinsic camera parameters.
As an exercise, let us undistort Image20.tif.这个函数帮助我们利用前面已经计算出来的摄像机内部参数来得到失真校正后的图像。让我们校正Image20.tif。
Click on Undistort image in the Camera calibration tool.
点击工具箱上的Undistort Image按钮。Enter 1 to select an individual image, and successively enter the image name without extension (Image20), the image type (tif). The main matlab window should look like this:
输入1,来选择单张图片,具体过程如下:The initial image is stored in the matrix I, and displayed in figure 2:
原始图像存储在矩阵I,显示在figure 2:The undistorted image is stored in the matrix I2, and displayed in figure 3:
校正后的图像存储在矩阵I2,显示在figure 3:The new undistorted image (I2) is also saved on disk under Image20_rect.tif.
新校正的图片(I2)也被保存在文件Image20_rect.tif。
Let us now undistort the complete set of calibration images. Click on Undistort image, and enter an empty argument to the first question. All the calibration images are then undistorted and saved onto disk underImage_rect1.tif,Image_rect2.tif, ..., Image_rect25.tif:
现在让我们校正所有的图片。点击Undistort image按钮,输入空参数,然后全部的校正图片被保存为Image_rect1.tif, Image_rect2.tif,...,Image_rect25.tif。Export calibration data to other formats (Willson-Heikkil� and Zhang): This function lets you export the calibration data (extracted image corners + associated 3D world coordinates) to Willson-Heikkil� or Zhang formats. This may be useful for comparison purposes (if you want to run other people calibration engines on the same data). This function may be used just after the corner extraction phase. Click onExport calib data in the main toolbox window.
将校正数据转换为其他格式(Willson-Heikkil和Zhang):这个方程允许你输出校正数据。可能被用在角点提取之后。点击Export calib data按钮:Enter 0 to select the data format used by Willson and Heikkil�, and enter the basename of the data files (shot). The calibration data of each image is then saved to individual filesshot1,shot2,...,shot25:
输入0来选择数据格式为Willson&Heikkil格式,输入后缀名(shot)。每张图片的校正数据被保存在单独的文件中shot1,shot2,...,shot25。
Let us now export the data under Zhang's format. Click on Export calib data, and enter1 to select that new export format. Enter then two file basenames: one for the 3D rig coordinates (Model) and one for the image coordinates (data). The program created then a set of text files (Model1.txt,data1.txt,...,Model25.txt,data25.txt) that can be read by Zhang's code. After export, your matlab window should look like:
让我们把输出的数据保存成为Zhang格式。点击Export calib data,输入1选择格式。输入两个基本名字:一个是rig coordinates(Model),另一个是图像坐标(data)。程序将创建一系列的txt文件(Model1.txt,data1.txt,...,Model25.txt,data25.txt),这些数据可以被Zhang的程序使用。显示如下:
First calibration example - Corner extraction, calibration, additional tools (三)
最新推荐文章于 2018-12-12 16:13:00 发布
Additional functions included in the calibration toolbox: