A Camera Calibration Tool

Download win32 executable
Download sample images
Download source code

1. Introduction

Every camera sees the world differently. Some have wide-angle lenses, capturing up to 180 degrees of the world; some distort the world, making straight lines look curved.

Such variance doesn't normally bother people, since they're looking for for an overall impression of a scene. But if a computer is to analyze a photograph, and to optionally reconstruct a scene from it, it must know exactly what it's seeing. The internal parameters of a camera, or intrinsics, are thus required to let a computer "see" the world. CamChecker allows you to find these intrinsics.

In short, if you can take pictures of chessboards, CamChecker can calculate your camera intrinsics.

2. Using CamChecker

2.1 Setting up

First, you need to find a chessboard or checkerboard. It should be flat; a laser-printed chessboard is ok, but not great (since paper isn't all that flat). And it should not be too shiny: since CamChecker finds edges in the chessboard, reflections might trick its edge detection.

Next, you need to get your camera ready. If you have a zoom lens, set it to a single zoom level, and leave it there during the calibration process. Each set of calculated intrinsics will only apply to one level of zoom.

2.2 Taking pictures

Take between 5 and 20 pictures of the chessboard (more is better), from various angles. Try to make the chessboard fill as much space in each picture as possible. Anything from about a 20 degree angle to a 90 degree angle is fine (where 90 degrees means looking at the chessboard head-on). Save these images to disk, so that CamChecker can load them.

2.3 Loading pictures into CamChecker

Select "load image(s)" from the file menu. A file dialog should pop up; use that to find your images, and use multiple selection (shift-click) to select them all (you can add more later, if you wish). Once you've hit "ok", it may take a little while for CamChecker to load them; be patient.

2.4 Calculating your intrinsics

Select "Global Intrinsics" from the "Compute" menu. This may take time (up to 5 or 10 minutes!). You might watch the command prompt window to see progress.

3. How it Works

3.1 The Basics

CamChecker works in two stages:

  1. It identifies corners on loaded chessboard images. This is mostly a matter of image processing.
  2. It uses those points to calculate intrinsics. This is a matter of linear algebra, and nonlinear optimization.
These two stages will now be explained in further detail.

3.2 Finding corner points

Each image is thresholded, and then dilated. This "splits" the corner points of the black squares from each other slightly, so that we can identify them as (slightly disconnected) squares.

Then, the image has its contours detected. This means that outlines will be drawn for each square, and possibly for other things (like extraneous things outside the chessboard). The contours are then simplified down to four corner points.

But still, not all the contours are chessboard squares. We can identify squares by noticing that all four of their contour corner points should be very close to those of other contours.

One starting contour is then picked. It must be fully connected (4 corners close to corners of other contours), and it should be the closest of its kind to the image center. Once picked, connected squares can then be "surfed", and 3d points may be associated with 2d points.

It is useful to note here that those 3d points all have a "Z" value of zero; only their "X" and "Y" values vary. This simplifying assumption makes the intrinsics calculations easier, and is the heart of Zhang's approach for calculating them.

3.3 Calculating intrinsics

The intrinsics calculations are based on Zhang's approach, whose paper is listed at the bottom of this page.

Roughly speaking, CamChecker does the following:

  1. Finds a closed-solution homography for each image
  2. Uses these to find a closed solution for the intrinsics/extrinsics
  3. Optimizes these intrinsics/extrinsics with Levenberg-Marquardt routines found in the GNU Scientific Library.

4. Suggested Reading:

Anyone interested in camera calibration should check out the following:

CamChecker is based in part on the work of the FLTK project (http://www.fltk.org).


Generated on Mon May 26 11:19:28 2003 for CamChecker by doxygen1.3