Define the camera model and measurement task

Zhang-style calibration uses observations of a planar pattern at several orientations to estimate perspective-camera intrinsics. The software can also estimate lens distortion and a board pose for each view. Fisheye, telecentric and other specialised optics need an appropriate projection model.

The focal parameters fx and fy are expressed in pixels, while cx and cy describe the principal point. Intrinsic skew describes the angle between image-coordinate axes; it is not the same parameter as a tilted-sensor distortion model. Standard OpenCV camera calibration normally assumes zero intrinsic skew.

A calibrated image point defines a viewing ray. Recovering a physical 3D point or a length also requires a known plane, depth, stereo geometry or another constraint. Intrinsics alone do not provide a universal millimetres-per-pixel factor.

Match squares, corners and coordinate order

For C square columns and R square rows, the internal-corner layout is (C − 1) × (R − 1). In OpenCV, patternSize is the number of internal corner columns followed by rows. Keep this convention consistent with the object-point array.

Use the same physical units throughout calibration and later pose calculations. With object coordinates in millimetres, the estimated translation is in millimetres. Uniformly changing the coordinate unit rescales translation; mixing units in later calculations causes a scale error.

Keep point identities consistent

A rectangular board with an odd number of squares along one axis and an even number along the other helps distinguish orientation when the detector uses border and colour information. This does not guarantee unique point identities for every detector, lighting condition or partial view.

For a single camera with independent board poses, a consistent reversal of all board coordinates within one view may be absorbed into that view’s pose. Stereo correspondence, robot hand-eye calibration and a fixed physical board origin have stricter requirements: verify that the same observed corner is assigned the same physical identity. Use a supported origin marker or ChArUco board when persistent identification is needed.

Capture information across the image field

Capture distinct positions and tilts about both board axes, including observations near image edges and corners. Pure front-facing translations poorly constrain the full intrinsic model. Stop adding repeated poses when they provide little new coverage; image count alone is not a quality measure.

  • Keep the lens focus, zoom and acquisition mode stable. Acquire under conditions representative of the intended measurement.
  • Choose tilts that add perspective information while preserving sharp, detectable corners across the board.
  • Use diffuse or controlled backlighting and avoid saturated squares, shadows and reflections.
  • Keep the border required by the detector visible. Partial-board support depends on the algorithm and target definition.

Inspect corner quality before fitting

Review an overlay of detected corners and their order on every accepted image. For classic findChessboardCorners, subpixel refinement such as cornerSubPix is often used with suitable settings; findChessboardCornersSB uses a different detector and already returns subpixel estimates. Follow the API used by your pipeline.

Subpixel localisation is a numerical estimate, not a guarantee of subpixel accuracy. Defocus, glare, edge asymmetry and motion can bias the estimate. Remove unusable captures because of these defects, rather than removing every high-residual view just to lower the overall score.

Read reprojection error in context

Reprojection RMS is the square root of the mean squared 2D distance between detected image points and the model projections, in pixels. Inspect per-view values and the residual field as well as the overall number. No single pixel threshold establishes suitability for every lens, field size or measurement tolerance.

Residual patterns and investigation
ObservationPossible checks
Large residuals near the edgesCheck edge coverage, corner sharpness and whether the distortion model represents the lens.
Residual vectors follow a spatial patternInspect board deformation, row/column scale errors, systematic corner bias and model mismatch.
One image is much worseReview motion blur, glare, ordering and acquisition settings in that capture.
A low fitting error but poor length measurementsVerify physical scale, units, measurement plane, pose and independent geometry.

Validate against independent geometry

Hold back images with useful field coverage from intrinsic fitting. Estimate their board poses using the fixed camera model and inspect residuals. Then measure known lengths or point positions independent of the calibration board wherever possible, at the actual working plane and distance.

Images withheld from the fit can reveal poor generalisation but still share the same board geometry errors. Independent reference lengths help test those systematic effects. For stereo or hand-eye systems, also validate the complete coordinate transform and the final task, rather than only each camera’s reprojection score.

Control the board in its working mount

A planar coordinate model assumes that the measured features lie in one plane to the accuracy required. Glass composition alone does not establish flatness. Clamping pressure, bonding, gravity and thermal gradients can change the working shape; evaluate the support and the active area together.

Pitch, orthogonality and corner-position errors can bias fitted parameters. Dimensional measurements should use a method whose uncertainty is appropriate to the tolerance; a handheld caliper does not establish micrometre-level corner accuracy. A measurement certificate retains its stated uncertainty and conditions.

Keep calibration tied to the image configuration

Save the camera and lens identifiers, focus and zoom positions, image size, crop, binning, board coordinates and units, model flags, captures and validation results. Changing focus, optics or mounting requires validation and may require recalibration.

A known resize or crop can sometimes be handled by transforming the intrinsic matrix, including the principal point, while retaining the same optical model. Verify pixel-coordinate conventions and the actual image pipeline; sensor binning or a new acquisition mode is not always equivalent to a simple resize. Set periodic checks from observed drift and measurement requirements rather than a universal calendar interval.

Explore the related product ranges

Checkerboard Calibration TargetsDot Array Calibration Targets

Related technical guides

Inspection and Acceptance of Patterned GlassDot Array or Checkerboard: Choosing a Camera Calibration TargetPattern Polarity, Film Side and Viewing DirectionDot-Array Camera Calibration: Geometry, Detection and Validation