Skip to content

Camera Calibration

This page explains the purpose of the camera calibration file and also describes the camera calibration procedure.

Why calibrate a camera?

The Track framework requires your camera device to be calibrated properly prior to any tracking. The goal of camera calibration is to find out the physical characteristics of your camera lens and sensor. A correct calibration enables accurate tracking results.

The resolution parameter defined in the calibration also determines the input resolution of the Track framework. Please ensure to perform camera calibration with one of the following supported input resolutions:

  • 640 x 360
  • 640 x 480
  • 1280 x 720
  • 1280 x 960

Parameters

The Track framework requires the intrinsic parameters (fx, fy, cx, cy) and the distortion coefficients (k1, k2, p1, p2, k3).

  • fx and fy refer to the camera's focal lengths in x and y directions respectively.
  • cx and cy refer to the principal points in x and y directions respectively.
  • k1, k2, and k3 refer to the radial distortions of the camera lens.
  • p1 and p2 refer to the tangential distortions of the camera lens.

If your camera calibration software does not provide 5 distortion coefficients, leave the k3 as 0.

You will need to calibrate each of your cameras, if you are planning to use the Track framework with different cameras. Also, you will need to re-calibrate your camera if you change any settings, such as camera zoom or using a different lens etc.

Camera calibration

To calibrate the camera, the followings are required:

  • Calibration board
  • Camera calibration software

Calibration board

To calibrate the camera, you need to prepare a physical calibration board.

The calibration board usually is made of a checkerboard pattern, which the square sizes on each longitudinal and lateral direction are equal.

You can download a sample checkerboard calibration board from here. The sample calibration pattern has 8x11 square pattern, with square size 20 mm.

You need to lay the calibration pattern on a flat surface. To get accurate results, you may stick the calibration pattern onto a flat board or a wall.

You need to prepare at least 15~20 pictures of a calibration board from various view points, as shown below. It is important not to take pictures from the same place, as it causes inaccurate calculation of the calibration parameters. When taking the pictures, the camera lens focus and the camera focal length must be fixed. Also, try to avoid image blur by keeping the camera and the calibration board steady. Ensure to take the images with one of the supported resolutions described above. Photo examples

Camera calibration software

To calculate the calibration parameters, you need to use a camera calibration software. You may pick one of these tools:

To be compatible with our calibration reader tool, save the calibration parameters in the following format:

calibration.json

{
  "Intrinsic": {
    "Resolution": [ 640.0, 480.0 ],
    "FocalLength": [ 656.85, 662.13 ],
    "PrincipalPoint": [ 305.06, 222.43 ],
    "Distortion": [ -0.361067, 0.125624, 0.001535, -0.002319, 0.0 ]
  }
}
Back to top