camera calibration MATLAB toolbox

2019-03-20 15:50发布

I have to perform re-projection of my 3D points (I already have data from Bundler).

I am using Camera Calibration toolbox in MATLAB to get the intrinsic camera parameters. I got output like this from 27 images (chess board; images are taken from different angles).

Calibration results after optimization (with uncertainties):

Focal Length:     fc = [ 2104.11696  2101.75357 ] ± [ 23.13283  22.92478 ]
Principal point:  cc = [  969.15779   771.30555 ] ± [ 21.98972  15.25166 ]
Skew:        alpha_c = [  0.00000 ] ± [ 0.00000  ]
Distortion:       kc = [  0.11555  -0.55754  -0.00100  -0.00275  0.00000 ] ± 
                       [ >0.05036   0.59076   0.00307   0.00440  0.00000 ]
Pixel error:     err = [  0.71656   0.63306 ]

Note: The numerical errors are approximately three times the standard deviations (for reference).

I am wondering about the numerical errors i.e. Focal length error +- [23.13283 22.92478] , principal point error etc. What these error numbers actually represent and what are their impact??

The pixel error is really less.

So far I use the following matrix from above data for my re-projection:

K=[ 2104.11696 0 969.15779; 0 2101.75357 771.30555;0 0 1]

The above matrix "K" seems right to me. Correct me if I am doing something wrong...

Will be waiting for your replies.

2条回答
成全新的幸福
2楼-- · 2019-03-20 16:28

The camera calibration toolbox extract grid points from the checker board images and uses it for finding calibration parameters.

The pixel errors are mean re-projection error for extracted grid points, i.e. the actual pixel location and the one by using calculated K matrix. So these numbers are mostly within 1 (1 pixel error) although your numbers are quite. The error in focal length is variance of calculated focal length.

You need only 3 or 4 images to find calibration of a camera (I forget the actual number). If you provide multiple images, it will compute K for all the combination of 3-4 images and compute a K. The errors are the variance of all these computed K.

Your numbers are quite high (it should be within 3-4 pixels compared to your 22-23 pixels). The reason is bad images for calibration and wrong initial estimate of grid points (this you do manually by selecting 4 corners in image). Also usually f_x and f_y are same in modern cameras and you should take mean of both (f_x + f_y)/2.

Regarding your principle point, it seems your camera resolution in 1920 x 1600 and you should use [980 800] instead of the one given by toolbox. Usually the ccd is placed carefully now-days and you have your principle point exactly at the center.

查看更多
爷的心禁止访问
3楼-- · 2019-03-20 16:38

There are two kinds of errors here.

One is the reprojection errors. Once you calibrate a camera, you use the resulting camera parameters to project the checkerboard points in world coordinates into the image. Then the reprojection erros are the distances between those projected points and the detect checkerboard points. The acceptable value for the reprojection errors depends on your application, but a good rule of thumb is that the mean reprojection error should be less than 0.5 of a pixel.

The other kind of errors are those +/- intervals you get for each estimate parameter. Those are based on the standard errors resulting from the optimization algorithm. The values that the Bouguet's Camera Calibration Toolbox gives you are actually 3 times the standard error, which corresponds to 99.73% confidence interval. In other words, if the Camera Calibration toolbox reports the focal length error as +- [23.13283 22.92478], then the actual focal length is within that interval of your estimate with the probability of 99.73%.

The reprojection errors give you a quick measure of the accuracy of your calibration. The standard errors - let's call them estimation errors - are useful for a more careful analysis of your results. For example, you should try excluding calibration images that have high mean reprojection error. On the other hand, if your estimation errors are high, you can try adding more calibration images.

By the way, the Computer Vision System Toolbox now includes a GUI Camera Calibrator app that makes camera calibration much easier. There is also a good explanation of the reprojection errors in the documentation.

查看更多
登录 后发表回答