Camera Calibration Toolbox for Generic Lenses

Version 2

Copyright (C) 2004-2008 Juho Kannala <>

Last updated: 2013-03-03 (Changed the software to be distributed under the MIT open source license.)


This is a camera calibration toolbox for Matlab which can be used for calibrating several different kinds of central cameras. A central camera is a camera which has a single effective viewpoint. The toolbox has been successfully used for both conventional and omnidirectional cameras such as fish-eye lens cameras and catadioptric cameras. The calibration is based on viewing a planar calibration object. The intrinsic and extrinsic camera parameters are estimated from control point correspondences between the calibration plane and calibration images. This toolbox is a result of research that has been carried out in the Laboratory of Computational Engineering at the Helsinki University of Technology and in the Machine Vision Group at the University of Oulu.

Changes to the first version

The most important changes are:

  1. The calibration algorithm has changed. The current implementation works better for lenses having a field of view significantly over 180 degrees.
  2. The interactive preprocessing step of calibration images has been improved. Now user may adjust the grayscale threshold that is used to extract the circular control points.

The first version is available here.


This software is distributed under the MIT License; refer to the file License.txt, for details.

Please use the following citations if you use this software in your work.


Toolbox: calibration_v23.tar.gz (calibration_v22.tar.gz)

Demo: fisheyedemo.tar.gz


Copy all the m-files into a directory and add it to your MATLABPATH. Matlab version 6.5 or later with the Image Processing Toolbox and Optimization Toolbox is required.

To run the demo extract the data from the above package into a directory and execute function FISHEYEDEMO.


There are two ways of using the toolbox:

  1. Given the point correspondences between the calibration plane and calibration images one may directly compute the camera parameters.
  2. If a calibration pattern with circular control points is used, one may extract the centroids of the projected circles from the calibration images by using an interactive procedure. After this the camera parameters may be computed.

For more instructions see the README file.

Calibration Pattern

You can use either one of the following two calibration patterns which have aspect ratios 16:9 and 4:3. For example, you can display the pattern on a flat screen display by using the full screen viewing mode of Acrobat Reader. The necessary distance ratios are given in the following configuration file. (The absolute metric dimensions of the displayed pattern are not necessary for the internal camera calibration. In this case, only the ratio between the control point radius and the gap of neighboring control points is significant. Optionally, in order to speed up the computation, you can use the pointlike approximation and set the radius of the control points to zero.)


Below there are two images of a planar calibration pattern taken with two different cameras. By using the calibrated values for the internal camera parameters both original images in the left are backprojected on the face of a cube whose centroid is at the viewpoint of the camera. The results of these warpings are shown on the right below and it can be seen that the scene lines are straight in the warped images. (The mapping from the calibration plane onto the cube is a central projection which preserves lines.)

Catadioptric camera:

Wide-angle lens camera:


  1. Juho Kannala and Sami S. Brandt. A generic camera model and calibration method for conventional, wide-angle and fish-eye lenses. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 28, no. 8, August 2006.
  2. Juho Kannala, Janne Heikkilä and Sami S. Brandt. Geometric camera calibration. Wiley Encyclopedia of Computer Science and Engineering, 2008.