# Camera Calibration using Single Input Image

Given a camera, permanently located at the same position, angle and distance from what is being captured, and a single calibration image ( a row of vertical lines [ | | | | ] ), how would one go about using the image to apply correction (barrel distortion) to all subsequent images?

Numerous examples exist online for the camera calibration problem, but most attempt to achieve the correction through guess-work, or highly involved processes to correct real-world images. However, I cannot find anything on calibrating a camera whose position and subject is always at the same position, and where the expected positions of vertical lines are known prior to correction.

The closest I've come to my approach is the plumb-line calibration method described by brown (1971).

Are there any algorithms or pseudo code out there which describes an approach to calibrate using a single input image of vertical lines (where distortion would be clealry visible by the gap between each line)?

Close-Range Camera Calibration - D.C, Brown

Take a look at this paper here: "Straight lines have to be straight" by Faugeras et al. http://link.springer.com/article/10.1007/PL00013269#page-1

It is straight forward to implement, but essentially removes distortions by observing the straightness of lines.

It should be straight forward to implement if you remove some automation (e.g. you click on the lines manually rather than relying on image processing).

Is there any reason why you do not want to use multiple calibration images? Take a look at the Camera Calibrator app in the Computer Vision System Toolbox for MATLAB. It takes most of the guess-work out of the process.

• Being in a fixed position with very little room to maneuver underneath, a single image approach reduces a lot of the hassle + my thinking is that given distorted lines and known "correct" coordinates, a single image would suffice. The little room under the camera would mean images would all be very similar, which might be detrimental due to over-learning. Jul 16, 2014 at 21:46
• The problem is that radial distortion is typically modeled as a high-degree polynomial, which cannot be easily inverted. So without doing proper calibration, you are left with methods that rely on some kind of non-linear optimization to straighten out the lines in the image.
– Dima
Jul 16, 2014 at 21:50
• On the other hand, if you calibrate your camera using multiple images, you can then move it, and still be able to remove distortion. So maybe, the calibration can be done before the camera is mounted.
– Dima
Jul 16, 2014 at 21:51

Yes, it can be done. The quality of results may be so-so, though. I'd recommend taking multiple images of slightly different targets (e.g. varying the spacing and/or the orientation of the lines), then merging the data in a single dataset.

As for the data themselves, my preference would be for a discrete set of well-defined points at known spacing - hence a checkerboard pattern.

You can see my other answer to a similar problem on S.O. for reference.

You can take a look at this article http://home.isr.uc.pt/~jpbar/Publication_Source/meloICCV2013.pdf. It calibrated the image from natural image lines. You can recover most of the calibration parameters and then apply them to the subsequent images.

• Any chance for more elaborate answer? I.e. what is the exact publication, why it is a best solution?
– jojek
Sep 1, 2015 at 17:27