I would like to correct lens distortions on a series of images. All the images were captured with the camera fixed in place, and a checkerboard image from the same set up is also available.
After detecting the corners of the distorted checkerboard image, I would like to compute the radial distortion coefficients so that I can correct the images. Similar to the estimateCameraParameters function.
Ideally, I would like to use a method similar to Matlab camera calibration however this does not seem to work for cases where only a single calibration image is available (and the images were all captured from the same location).
Appreciate any assistance.
The correction of lens distorsion only depends on the camera itself, not the position of the camera (one speaks also about intrinsic camera parameters). So one image (with enough reference points) is enough to compute this set of parameters.
If you consider only radial distorsion, a simple case is to fix the center of distorsion (commonly at the center of the image), your model can be like R' = R*(1+a*R^2+b*R^4)
. First correct the image with extrisic camera parameters, to remove all homographic distorsion. Estimating the camera pose first is really important.
Having the positions of the points of the chessboard, you can compute their distances to the center of distorsion (R'), and the corresponding distances you expect (R). Then you have a set of linear equations, so the solution can be robustly found with SVD for example.
A more complex method is sketched in OpenCV documenation.
来源:https://stackoverflow.com/questions/21130509/correct-lens-distortion-using-single-calibration-image-in-matlab