Lens Calibration

Main Menu: Calibration > Generate Lens Calibration Matrix
S
hortcut: Ctrl-Alt-L

Lens Calibration is the procedure that fixes lens distortion in images. It is useful when using lenses with noticeable distortion to correct images in order to show a view as approximate to the reality as possible.

One standard way to calculate a lens distortion is to use a chessboard pattern (8 rows x 8 columns of squares). which looks like this:

At least ten pictures of the chessboard must be taken with different orientations. These orientation should vary a lot to allow the software to compute properly the lens distortion.

An example of possible chessboard orientations for the ten pictures should be like this:

The chessboard may be hold by a person or placed inside any scene with a  reasonably uncluttered background.

Example of distorted (to the left) and undistorted images (to the right):

Correcting Lens Distortion

  1. First you need a printed copy of a chessboard, to take the pictures, use always an 8 rows x 8 columns black and white chessboard.
    If you need a chessboard, Bersoft Image Measurement may print one for. After simply paste the sheet on a rigid surface and shoot several pictures with your camera. To print a chessboard image click the Calibration > Generate Lens Calibration Matrix menu to open the Lens Calibration window and click the Print Chessboard button located there.
    The minimal number of pictures is ten, but in case some of them cannot be used by the program, shoot a few more to be on the safe side. Theoretically, the more pictures you shoot, the more accurate will be the calibration, hence up to 50 pictures can be used to calibrate a lens, but in most cases between 10 and 20 should be enough. You can save the images as BMP, TIF, JPEG or PNG files.

  2. After you have the pictures ready, click the Calibration > Generate Lens Calibration Matrix menu to open the Lens Calibration window and click the Add Images button to select the images to be used for the calibration. You can select several images at once by pressing the Shift key while you select the files in the Open Images Dialog.
    All images should have the same size and should be taken with the same focal length, without zooming in/out in between images.

  3. Click  Generate & Save Calibration Matrix button. You will save the calibration matrix as a file, that may be used at any time afterwards to correct the lens distortion. If the software cannot process some of your images it will notify you which images are bad, you may need to take new pictures of some images in that case and repeat the process.
    If you see no error message, then the calibration matrix was generated and saved successfully and it is enabled (until you close Bersoft Image Measurement) to correct lens distortion.

  4. To undistort one image, click the Calibration > Apply Calibration Matrix menu. That menu will become enabled after you generated successfully a calibration matrix or if you load a previously generated calibration matrix using the Calibration > Load Lens Calibration Matrix menu.