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.
Terms used in this lesson
Section titled “Terms used in this lesson”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 |
Intrinsics: one camera on its own
Section titled “Intrinsics: one camera on its own”The starting point is the pinhole model, which treats the camera as a single point that every ray passes through (Camera Calibration).
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
resolutionthey 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.
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).
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-equiand 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: where the second camera sits
Section titled “Extrinsics: where the second camera sits”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).
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_cnm1isT_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
stereoCalibratereturns 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 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.
What the solver does with all this
Section titled “What the solver does with all this”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.
Self-check
Section titled “Self-check”- Your team switches the stereo cameras from full resolution to a 2 × 2 binned mode. Can they keep the calibration?
- 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?
- In a Kalibr camchain, what does
T_cn_cnm1under cam1 map from and to, and what is the length of its translation? - Why might a team pick Kannala–Brandt even though double sphere fits as well and projects faster?
Answers
Section titled “Answers”- No. Intrinsics are only valid at the resolution they were fitted at; a new binning mode needs a new calibration.
- Models defined on the 3D ray: double sphere (
ds-none), EUCM (eucm-none) or unified with radtan (omni-radtan). Kalibr’spinhole-equihas a singularity at 90° off axis that makes it unsuitable near 180°. - It maps cam0 coordinates into cam1 coordinates (
T_c1_c0). The length of its translation is the baseline, in metres. - 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.
Sources
Section titled “Sources”- Field guide: Camera Calibration, Lens Projections and Distortion, Calibration Tools Compared, Calibrating a Stereo or Multi-Camera Rig, Kalibr File Reference, glossary.
- Usenko, V., Demmel, N. and Cremers, D. (2018). The double sphere camera model. International Conference on 3D Vision (3DV).
- OpenCV calib3d module reference (
stereoCalibrate, distortion models). - Kalibr wiki, ETH Zurich ASL: YAML formats.