Camera Calibration Toolbox For Matlab
Camera Calibration Toolbox For Matlab
Camera Calibration Toolbox For Matlab
http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html
After calibration, the list of parameters may be stored in the matab file Calib_Results by clicking on Save. The list of variables may be separated into two categories: Intrinsic parameters and extrinsic parameters.
Let r2 = x2 + y2. After including lens distortion, the new normalized point coordinate xd is defined as follows:
Therefore, the 5-vector kc contains both radial and tangential distortion coefficients (observe that the coefficient of 6th order radial distortion term is the fifth entry of the vector kc). It is worth noticing that this distortion model was first introduced by Brown in 1966 and called "Plumb Bob" model (radial polynomial + "thin prism" ). The tangential distortion is due to "decentering", or imperfect centering of the lens components and other manufacturing defects in a compound lens. For more details, refer to Brown's original publications listed in the reference page. Once distortion is applied, the final pixel coordinates x_pixel = [xp;yp] of the projection of P on the image plane is:
Therefore, the pixel coordinate vector x_pixel and the normalized (distorted) coordinate vector xd are related to each other through the linear equation:
In matlab, this matrix is stored in the variable KK after calibration. Observe that fc(1) and fc(2) are the focal distance (a unique value in mm) expressed in units of horizontal and vertical pixels. Both components of the vector fc are usually very similar. The ratio fc(2)/fc(1), often called "aspect ratio", is different from 1 if the pixel in the CCD array are not square. Therefore, the camera model naturally handles non-square pixels. In addition, the coefficient alpha_c encodes the angle between the x and y sensor axes. Consequently, pixels are even allowed to be non-rectangular. Some authors refer to that type of model as "affine distortion" model. In addition to computing estimates for the intrinsic parameters fc, cc, kc and alpha_c, the toolbox also returns estimates of the uncertainties on those parameters. The matlab variables containing those uncertainties are fc_error, cc_error, kc_error, alpha_c_error. For information, those vectors are approximately three times the standard deviations of the errors of estimation.
1 de 3
24/04/2012 18:53
http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html
In this case fc = [657.30254 ; 657.74391] and fc_error = [0.28487 ; 0.28937], cc = [302.71656 ; 242.33386], cc_error = [0.59115 ; 0.55710], ...
Important Convention: Pixel coordinates are defined such that [0;0] is the center of the upper left pixel of the image. As a result, [nx-1;0] is center of the upper
right corner pixel, [0;ny-1] is the center of the lower left corner pixel and [nx-1;ny-1] is the center of the lower right corner pixel where nx and ny are the width and height of the image (for the images of the first example, nx=640 and ny=480). One matlab function provided in the toolbox computes that direct pixel projection map. This function is project_points2.m. This function takes in the 3D coordinates of a set of points in space (in world reference frame or camera reference frame) and the intrinsic camera parameters (fc,cc,kc,alpha_c), and returns the pixel projections of the points on the image plane. See the information given in the function.
Our notation fc(1) fc(2) cc(1) cc(2) alpha_c kc(1) kc(2) kc(3) kc(4) kc(5) A few comments on Heikkil's model:
Heikkil's notation f . Du . su f . Dv u0 v0 0 f3 . k1 f5 . k2 f2 . p1 f2 . p2 0
Skew is not estimated (alpha_c=0). It may not be a problem as most cameras currently manufactured do not have centering imperfections. The radial component of the distortion model is only up to the 4th order. This is sufficient for most cases. The four variables (f,Du,Dv,su) replacing the 2x1 focal vector fc are in general impossible to estimate separately. It is only possible if two of those variables are known (for example the metric focal value f and the scale factor su). See Heikkil's paper for more information.
2 de 3
24/04/2012 18:53
http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html
Willson uses a first order radial distortion model (with an additional constant kappa1) that does not have an easy closed-form corespondence with our distortion model (encoded with the coefficients kc(1),...,kc(5)). However, we included in the toolbox a function called willson_convert that converts the entire set of Willson's parameters into our parameters (including distortion). This function is called in another function willson_read that directly loads in a calibration result file generated by Willson's code and computes the set parameters (intrinsic and extrinsic) following our notation (to use that function, first set the matlab variable calib_file to the name of the original willson calibration file). A few extra comments on Willson's model: Similarly to Heikkil's model, the skew is not included in the model (alpha_c=0). Similarly to Heikkil's model, the four variables (f,sx,dpx,dpy) replacing the 2x1 focal vector fc are in general impossible to estimate separately. It is only possible if two of those variables are known (for example the metric focal value f and the scale factor sx).
Extrinsic parameters:
Rotations: A set of n_ima 3x3 rotation matrices Rc_1, Rc_2,.., Rc_20 (assuming n_ima=20). Translations: A set of n_ima 3x1 vectors Tc_1, Tc_2,.., Tc_20 (assuming n_ima=20).
Let P be a point space of coordinate vector XX = [X;Y;Z] in the grid reference frame (reference frame shown on the previous figure). Let XXc = [Xc;Yc;Zc] be the coordinate vector of P in the camera reference frame. Then XX and XXc are related to each other through the following rigid motion equation: XXc = Rc_1 * XX + Tc_1 In particular, the translation vector Tc_1 is the coordinate vector of the origin of the grid pattern (O) in the camera reference frame, and the thrid column of the matrix Rc_1 is the surface normal vector of the plane containing the planar grid in the camera reference frame. The same relation holds for the remaining extrinsic parameters (Rc_2,Tc_2), (Rc_3,Tc_3), ... , (Rc_20,Tc_20). Once the coordinates of a point is expressed in the camera reference frame, it may be projected on the image plane using the intrinsic camera parameters. The vectors omc_1, omc_1, ... , omc_20 are the rotation vectors associated to the rotation matrices Rc_1, Rc_1, ... , Rc_20. The two are related through the rodrigues formula. For example, Rc_1 = rodrigues(omc_1). Similarly to the intrinsic parameters, the uncertainties attached to the estimates of the extrinsic parameters omc_i, Tc_i (i=1,...,n_ima) are also computed by the toolbox. Those uncertainties are stored in the vectors omc_error_1,..., omc_error_20, Tc_error_1,..., Tc_error_20 (assuming n_ima = 20) and represent approximately three times the standard deviations of the errors of estimation.
3 de 3
24/04/2012 18:53
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: