Main Content

Calibration Patterns

The Camera Calibrator and Stereo Camera Calibrator app support checkerboard, circle grid, and custom detector patterns to extract keypoints. The apps enable you to select a checkerboard, symmetric circle grid, or asymmetric circle grid detector pattern. The apps also provide the ability for you to add a custom pattern detector, and provide built-in templates to help you create it.

What Are Calibration Patterns?

Camera calibration estimates the parameters of a lens, the image sensor of an image, or a video camera. You can use these parameters to estimate structures in a scene and to remove lens distortion. The camera parameters include:

  • Intrinsics — These relate to the internal characteristics of a camera, such as the focal length, the optical cente (also known as the principal point), and the skew coefficient.

  • Extrinsics — These describe the location (position and orientation) of the camera in the 3-D scene.

For more detail on how intrinsics and extrinsics are calculated, and explanations of single camera (pinhole) and fisheye camera calibration, see What Is Camera Calibration? and Fisheye Calibration Basics, respectively.

To estimate the intrinsics and extrinsics parameters, you need 3-D world points and their corresponding 2-D image points. You can get these correspondences by using multiple images of a calibration pattern. The calibration pattern, sometimes known as a calibration grid or a calibration target, is a repeating pattern of known size and spacing.

For example, a checkerboard pattern consists of alternating white and black squares of equal size. The corners of the squares that lie inside the pattern are used as the control points. These corners can be detected on the 2-D calibration image automatically by using a corner detector algorithm. By assuming the lower-right corner point of the top-left square of the checkerboard is the origin, we can also determine their 3-D world coordinates of the points by using the square size of the checkerboard.

Checkerboard pattern, with origin labeled.

Similar assumptions are used to identify the origin in different types of calibration patterns, so that algorithms can automatically identify them based on their structure. When calibrating stereo cameras, the origin of the pattern must be uniquely identifiable, and thus should not have 180-degree ambiguity. This means, the pattern should not look the same when rotated by 180 degrees. These are examples of calibration patterns that contain 180-degree ambiguity, and should be avoided when calibrating stereo cameras:

Checkerboard, asymmetric, and symmetric grid patterns with 180-degree ambiguity

Supported Patterns

Computer Vision Toolbox™ contains an example pattern for each of the natively supported pattern types. To open a PDF file for any of these supported patterns, select the link or type the corresponding command at the MATLAB® prompt:

Checkerboard Pattern

The checkerboard pattern is the most commonly used calibration pattern for camera calibration. The control points for this pattern are the corners that lie inside the checkerboard. Because corners are extremely small, they are often invariant to perspective and lens distortion. The calibrator apps can also detect partial checkerboards, which can be useful when calibrating cameras with wide-angle lenses. Use a checkerboard that contains an even number of squares along one edge and an odd number of squares along the other edge, with two black corner squares along one side and two white corner squares on the opposite side. This enables the app to determine the orientation of the pattern and the origin. The calibrator assigns the longer side as the x-direction. A square checkerboard pattern can produce unexpected results for camera extrinsics.

5-by-6 checkerboard, 6-by-5 checkerboard, and 5-by-5 checkerboard

To prepare the checkerboard pattern:

  1. Attach the checkerboard printout to a flat surface. Imperfections on the surface can affect the accuracy of the calibration.

  2. Measure one side of a checkerboard square. You need this measurement for calibration. The size of the squares can vary depending on printer settings.

    Close-up of checkerboard square, indicating the length of one side as the size of the checkerboard square

  3. To improve detection speed, set up the pattern with as little background clutter as possible.

Circle Grid Patterns

Circle grid patterns, sometimes referred to as a grid of circles, are a class of calibration patterns that use evenly spaced circles to form a grid structure. They are broadly classified into two types: symmetric and asymmetric patterns.

PatternExampleDescription

Symmetric

Symmetric circle grid

  • Circles are arranged evenly in rows and columns

  • Dimensions are measured in number of circles as [height width], where height is the number of circles in one row and width is the number of circles in one column.

  • Cannot be used to calibrate stereo cameras due to 180-degree ambiguity.

Asymmetric

Asymmeteric circle grid

  • Every second row of circles is offset by half the column distance between neighboring row elements.

  • Dimensions are measured in number of circles as [dim1 dim2], where

    dim1 is the number of circles along the dimension that contains the same number of circles in each row or column and dim2 is the number of circles across two adjacent columns (or rows) in the dimension where the two columns (or rows) contain an unequal number of circles.

  • Greater density of points for the same circle radius.

  • Can be used to calibrate stereo cameras. No 180-degree ambiguity.

Custom Detector Pattern

You can create a custom pattern by using a template. When loading your images into the calibrator, in the properties dialog box, expand the Custom Pattern section and select Import Pattern Detector to open the template. For an example of creating and using a custom template, seeCamera Calibration Using AprilTag Markers.

See Also

Apps

Related Examples

More About