Skip to content

C201 Lesson 1: What Calibration Estimates

A calibration turns a camera that takes pictures into one that measures. For a stereo rig it holds two kinds of number: how each camera turns a direction into a pixel, and where each camera sits relative to the other. This lesson names every part and says which choices matter for the fisheye lenses on current head rigs. The full treatment is on Camera Calibration.

All of these are also in the glossary’s calibration section.

Term Meaning
Intrinsics The camera model and its parameters (focal length, principal point, distortion) that map a direction in the camera’s frame to a pixel
Focal length In pixels, one value per image axis; it sets how much of the world each pixel covers
Principal point Where the optical axis meets the sensor, in pixels; near the image centre but rarely exactly at it
Projection model The formula that maps a ray’s angle from the optical axis to a distance from the principal point
Distortion How a real lens departs from an ideal projection; it moves image points without blurring them
Extrinsics The rotation R and translation t that take points from one camera’s frame to another’s
Baseline The distance between two cameras’ optical centres, the length of t
Reprojection error The distance in pixels between a detected target corner and where the calibrated model predicts it

The starting point is the pinhole model, which treats the camera as a single point that every ray passes through (Camera Calibration).

The pinhole model behind the intrinsics Side view of the pinhole camera model. A ray from a 3D point in the world passes through the camera centre and lands on the image plane at the image point. The optical axis meets the image plane at the principal point. The distance from the camera centre to the image plane is the focal length, measured in pixels. 3D point in the world image point (u, v) principal point (cx, cy) focal length f, in pixels camera centre image plane (the sensor) optical axis
The pinhole model. A ray from a point in the world passes through the camera centre and lands on the sensor. Focal length and principal point, in pixels, are the core intrinsics.

The pinhole intrinsics are four numbers: two focal lengths and the two coordinates of the principal point. Kalibr writes them as [fu, fv, pu, pv] (Kalibr File Reference). On a sensor with square pixels, fu and fv should be very close.

Two rules follow from what intrinsics are:

  • They belong to one image size. The Kalibr reference puts it plainly: the intrinsics are only valid at the resolution they were fitted at. A different resolution, crop or binning mode needs a new calibration (resolution).
  • They belong to one lens state. Autofocus, optical image stabilisation and electronic stabilisation all change the mapping from frame to frame, so a measuring camera locks them or does without them. If someone turns a focus ring after calibration, the calibration is gone (Camera Calibration). The reason is optical: the pinhole “focal length” is really the lens-to-sensor distance, and focusing closer moves the lens out, so the focal length in pixels grows (Focus changes the intrinsics).

Projection and distortion: why fisheye lenses need their own model

Section titled “Projection and distortion: why fisheye lenses need their own model”

Real lenses bend straight lines, most at the edges of the image. Distortion coefficients describe that bending so it can be corrected.

Lens distortion: an ideal grid and a wide-angle lens Left: a square grid as an ideal pinhole camera images it, every line straight. Right: the same grid through a wide-angle lens with barrel distortion. Lines bow outward and the effect grows toward the edges of the image, which calibration measures and corrects. Ideal pinholeWide-angle lensstraight lines stay straightlines bow, most at the edges
Real lenses bend straight lines, most at the edges of the image. The distortion coefficients describe that bending so it can be corrected.

A wide lens bends lines on purpose. Every lens maps a ray at angle θ from the optical axis to a radius r on the sensor, and lenses are designed to one of a few projection functions. The perspective (pinhole) projection, r = f · tan(θ), runs to infinity at 90°, so no rectilinear lens reaches a 180° view; fisheye lenses follow other projections, such as the equidistant r = f · θ (Lens Projections and Distortion).

Projection functions: image radius against ray angle A plot of image radius r, in units of the focal length f, against the angle theta between an incoming ray and the optical axis, from 0 to 100 degrees. The perspective curve r = f tan theta climbs steeply and goes to infinity at 90 degrees. The fisheye curves stay finite: stereographic r = 2f tan(theta/2) reaches 2f at 90 degrees, equidistant r = f theta is a straight line reaching about 1.57f, equisolid r = 2f sin(theta/2) reaches about 1.41f, and orthographic r = f sin theta flattens to f at 90 degrees. All five agree near the axis. 0°20°40°60°80°100°0123 angle of the ray off the optical axis, θ image radius r, in units of f perspectivestereographicequidistantequisolidorthographic
How far from the image centre a ray lands (r, in units of f) for a ray arriving θ off the axis. The perspective (pinhole) curve r = f·tan θ runs to infinity at 90°, so no rectilinear lens can reach a 180° view. The fisheye projections stay finite. All five agree near the axis, which is why a narrow lens looks like a pinhole.

This is why the classic pinhole-plus-polynomial model gives out on fisheye lenses. The double sphere paper (Usenko, Demmel and Cremers, 2018) found that “in practice, even when distortion model is added the pinhole camera demonstrates suboptimal performance for a field-of-view greater than 120°”. The models built for wide lenses, and their names in the tools this course uses:

Model What it assumes Kalibr OpenCV mrcal
Pinhole + radial–tangential a nearly rectilinear lens pinhole-radtan calibrateCamera LENSMODEL_OPENCV4/5/8/12
Kannala–Brandt (equidistant) image radius is an odd polynomial in θ pinhole-equi cv::fisheye not documented
Extended unified (EUCM) projection through an ellipsoid; closed-form inverse eucm-none not documented not documented
Double sphere projection through two unit spheres; closed-form inverse ds-none not documented not documented
Splined a flexible surface fitted to the lens no no LENSMODEL_SPLINED_STEREOGRAPHIC

The table is taken from Calibration Tools Compared; the formulas are on Lens Projections and Distortion.

Three findings guide the choice for a fisheye stereo rig:

  • Kannala–Brandt has a limit near 180°. Kalibr’s pinhole-equi and OpenCV’s fisheye module apply it after a pinhole projection, so it has a singularity at 90° off axis, “which makes it unsuitable for fisheye lenses with field-of-view close to 180°” (double sphere paper).
  • Double sphere and EUCM fit nearly as well, and faster. On lenses from 122° to 195°, the double sphere model had “less than 1% greater reprojection error compared to KB 8 on all sequences”, and its projection was about 5.6 times faster (Calibrating a Stereo or Multi-Camera Rig).
  • Use the model your pipeline consumes. A SLAM system or dataset format that expects Kannala–Brandt parameters gains nothing from a better fit in a model it cannot read (Lens Projections and Distortion).

One more check applies to any model: real radial distortion is monotonic. OpenCV’s documentation treats a non-monotonic fit as “a calibration failure”, and one way it happens is a target that never reached the image corners (Lens Projections and Distortion).

Extrinsics are the rotation R and translation t between two cameras’ frames. On a rigid head unit they are fixed by the mechanics; a wrist camera moves relative to the head and is tracked per frame instead (Camera Calibration).

Extrinsics: where each sensor sits relative to the others A head seen from above with a stereo camera pair at the front and an IMU behind them. Each sensor has its own coordinate frame. The rotation and translation from the left camera to the right camera, and from the camera to the IMU, are fixed by the rig and are calibrated once. A wrist camera's position relative to the head changes every frame, so it is tracked, not calibrated. Every sensor also needs its time offset. left to right: R, t Fixed by the rig: calibrate once camera to IMU: R, t IMU wrist camera Moves every frame: tracked, not calibrated plus, for every sensor: its time offset
Extrinsics are the rotation R and translation t between sensors. On a rigid head unit they are fixed and calibrated once; a wrist camera moves relative to the head, so its pose is tracked frame by frame instead.

For a stereo pair, the extrinsics set the depth. Stereo depth is z = f·b / d, so a baseline that is 1% wrong makes every depth 1% wrong (Calibrating a Stereo or Multi-Camera Rig).

The direction of a transform is the classic mistake, and nothing warns you about it:

  • Kalibr writes every transform as T_a_b, which takes a point in frame b and returns it in frame a. For cam1, T_cn_cnm1 is T_c1_c0, which in the Kalibr wiki’s words “takes cam0 to cam1 coordinates”. Its translation is in metres, and its length is the baseline (How Kalibr names transforms).
  • OpenCV’s stereoCalibrate returns R and T where “this matrix brings points given in the first camera’s coordinate system to points in the second camera’s coordinate system” (OpenCV calib3d reference).
The transforms in a Kalibr camchain-imucam.yaml Three coordinate frames: the IMU, cam0 and cam1. An arrow from the IMU to cam0 is labelled T_cam_imu stored under cam0, meaning it takes a point in IMU coordinates to cam0 coordinates. An arrow from cam0 to cam1 is labelled T_cn_cnm1 stored under cam1, which equals T_c1_c0 and takes a point in cam0 coordinates to cam1 coordinates. A third arrow from the IMU to cam1 is labelled T_cam_imu stored under cam1. The rule printed below: T_a_b takes a point expressed in frame b and returns it expressed in frame a. IMU (imu0) cam0 cam1 cam1: T_cn_cnm1 = T_c1_c0 cam0 coordinates to cam1 cam0: T_cam_imu cam1: T_cam_imu T_a_b takes a point in frame b and returns it in frame a
How Kalibr names its transforms. T_a_b takes a point given in frame b and returns it in frame a. Each camera block in camchain-imucam.yaml stores T_cam_imu (IMU to that camera), and every camera after cam0 stores T_cn_cnm1 (the previous camera to this one, so cam1 holds T_c1_c0).

The translation of T_a_b is the origin of frame b seen from frame a. Comparing its length with a ruler is the quickest check that you have read it the right way round.

A calibration solver shows the cameras a target of known geometry, predicts where each corner should land given the current parameters, and adjusts every parameter until the predicted corners land as close as possible to the detected ones. That gap is the reprojection error, the number every tool reports (Camera Calibration). Lessons 2 to 4 cover the views it needs, the tools that solve it and why a low error alone proves little.

  1. Your team switches the stereo cameras from full resolution to a 2 × 2 binned mode. Can they keep the calibration?
  2. Your lenses have a field of view close to 180°. Which Kalibr models does the field guide point you to, and which one does it warn against?
  3. In a Kalibr camchain, what does T_cn_cnm1 under cam1 map from and to, and what is the length of its translation?
  4. Why might a team pick Kannala–Brandt even though double sphere fits as well and projects faster?
  1. No. Intrinsics are only valid at the resolution they were fitted at; a new binning mode needs a new calibration.
  2. Models defined on the 3D ray: double sphere (ds-none), EUCM (eucm-none) or unified with radtan (omni-radtan). Kalibr’s pinhole-equi has a singularity at 90° off axis that makes it unsuitable near 180°.
  3. It maps cam0 coordinates into cam1 coordinates (T_c1_c0). The length of its translation is the baseline, in metres.
  4. Because the rest of the pipeline reads Kannala–Brandt. A model the SLAM system or dataset format cannot consume is no use, however well it fits.