Sextant - Camera Calibration TOOL
metaio provides Sextant, a camera calibration utility which provides an easy calibration of the camera using either a live "automatic mode" or a "manual mode". A general introduction to camera calibration can be found here.
The live "automatic mode" can be used when you want to calibrate a camera 'on-the-fly'. The "manual mode" can be used when you want to calibrate a camera using images of the calibration pattern which have been captured by that camera.
After you created a camera calibration file, you can load it into the Unifeye GUI (via the configuration tool "Camera calibration") or into the Workflow Authoring GUI (via the "Load Camera Calibration" Action).
Setting up the calibration pattern
- The calibration pattern is a chessboard pattern.
- The pattern can be a square or a rectangle.
- You can have as many squares as your camera resolution will allow, but there should be a minumum of 4 squares along the width and the height for decent calibration.
- Every square in the pattern must be equal in size. Please take care that the image is not skewed after printing.
- The size of the calibration pattern is pretty much determined by the resolution of your camera. The higher the number of squares, the more accurate the calibration. A camera supporting only 320x240 with high distortion will not be able to recognize all the corner-points in a 17x17 pattern, hence it would be better to use a 11x9 pattern.
- Mount the printed image on a flat surface like for e.g. glass, and ensure that it is completely even on the surface.
- The image below shows us a square calibration pattern with 18x12 squares along width and height.

A square calibration pattern
Setting up the camera
- Adjust the camera properties for brightness and contrast.
- Adjust the camera focus so that the corners in the calibration pattern are sharp.
- The camera properties can be quickly adjusted through the color and size buttons on the Camera Control section in Sextant.
User Interface Elements
- The screenshot below is the user interface for Sextant.
- It has 4 main sections:
- Source - Allows you to set the source for calibration. You can either calibrate a video camera by direclty loading it or by adding still image shots.
- Activate Camera - Allows you to select cameras and adjust their properties:
- Load Camera - This will enumerate cameras plugged into your system and store their names in the drop down box. If you plug in/out a camera then please call 'load' once again.
- Select Camera - This will activate the camera and you should be able to see images from the camera immediately.
- Settings and Resolution - These buttons allow you to change the image-properites on the camera (e.g. brightness, contrast, hue etc.) . The properties vary depending upon the driver and manufacturer of the camera.
- Size - This allows you to change the size of the image. e.g. 320x240, 640x480. The size varies depending upon the driver and manufacturer of the camera.
- Calibration Parameters:
- Number of calibration shots [3/6/10] - The more the number of calibration shots the more accurate the calibration. However if two calibration shots are very similiar to each other then the error would also increase. If your camera has a very large distortion and it is difficult to take calibration shots from varying angles then you can simply select a lower number.
- Countdown Range (secs.) - The countdown duration for which the result is displayed on the screen after calibration is completed.
- Calibration pattern size:
- Squares along width - The total number of outer squares along the width. (This information is can be found on the print of your calibration pattern.)
- Squares along width - The total number of outer squares along the height. (This information can be found on the print of your calibration pattern.)
- Square size (cm) - The size of each square in the calibration pattern. (This information can be found on the print of your calibration pattern.)
- Apply Parameters - Apply the parameters that were selected above in 'Calibration parameters'.
- Results: The file containing the calibration results is created automatically once the calibration is completed.
- Additional info - This field allows you to save additional information into the result file. For e.g. "3.5mm Lens".
- Results should be save to - This field allows you to specify the name of the xml file which will contain the results.
- Calibration Control:
- Automatic:
Start calibration - Start the automatic camera calibration.
- Manual: Add Shot - Add a calibration shot from a file. A calibration shot is simply an image captured by the camera. .bmp/.jpg/.gif file formats are supported.
- Abort - Automatic or manual calibration can be aborted at any time.

The camera calibration tool
Working with Sextant
- Automatic mode - In this mode we attempt to calibrate a camera 'on-the-fly' using a calibration pattern.
- Select 'Camera' as source.
- Press 'Load camera' to enumerate the connected cameras on the system
- Select a camera from the drop down.
- Adjust the image quality and size as required using 'Settings' and 'Resolution' buttons.
- Set the calibration parameters.
- Press 'Apply Parameters'.
- Press 'Start Calibration' and move your camera over the calibration pattern. Sextant will wait for 5 seconds till it locates the calibration pattern for the first time and will take a calibration shot. After taking a shot, a shutter effect is visible and Sextant will give you another 5 seconds to move the camera to a different location. Sextant is interested in detecting the inner corners of the calibration pattern. If all the corners are detected then colored lines are drawn across the pattern. If some corners are out of focus or not very clear then a red 'x' marks all the detected corners. The undetected corners have no mark. Please move your camera and/or adjust the focus so that all corners are detected. The screenshots below show how the overlay information is displayed.
- The number at the top center (here '2') indicates a countdown timer.
- The top left section contains 2 numbers (here '0/6'). This indicates that Sextant requires 6 calibration shots to complete calibration and that currently no shots have been taken.
- We also see in the top left corner 'Calib. pts: 17x11' . This indicates that the chessboard size was given as 18x12 and hence the total number of inner corners that Sextant wants are 17x11. The calibration points thus along x and y are always 1 less than the number of squares specified.
- The bottom section of the screen always contains a status information display.
- Screenshot showing corners that have not been detected.
- Screenshot showing colored lines indicating all corners are detected and that this is a good candidate for a calibration shot.
- Screenshot indicating that calibration is over and results are displayed as well as written to the file "c:\calibrationresults.xml".
- Manual mode
- The same process as above is followed for manual mode, except that the calibration shots are entered manually.
- Screenshot showing one calibration shot.
- If Sextant is unable to detect corners in the calibration shot then simply pass another calibration shot.
Taking good calibration shots
- Please keep the following points in mind while taking calibration shots:
- Try not to take calibration shots lower than 45° along an axis as indicated in the following screenshot.
- Do not take more than one shot from the same position. This is very important. If more than one shot is taken from the same position then the accuracy of the calibration is badly affected. This also applies for manual calibration, i.e. do not supply the same calibration shot more than once.
What the results look like
- The screenshot illustrates the contents of CalibrationResults.xml.
CalibrationResults.xml
For increasing the overall system performance (especially on high resolutions) you can switch off the undistortion while keeping the general calibration. For doing this, please edit the resulting file of the camera calibration (
CalibrationResults.xml) and setting all sub tags of
<Distortion> to 0.0. Editing can be done by opening the file in a simple text editor like Notepad of Windows. The example above would thus look like:
<?xml version="1.0"?>
<Camera>
<Name>Philips ToUcam Pro Camera; Video</Name>
<Info />
<CalibrationResolution>
<X>640</X>
<Y>480</Y>
</CalibrationResolution>
<FocalLength>
<X>1052.56091</X>
<Y>1051.6405</Y>
</FocalLength>
<PrincipalPoint>
<X>354.364319</X>
<Y>266.298981</Y>
</PrincipalPoint>
<Distortion>
<k1>0.0</k1>
<k2>0.0</k2>
<p1>0.0</p1>
<p2>0.0</p2>
</Distortion>
</Camera>