Core · 1 of 1318 minModule 00

Why calibration is worth learning

See how calibration errors turn into measurement, pose, and overlay failures.

Not started Open Python lab

In this lesson

What you'll learn

  • Decide when a task needs calibration and what to verify before relying on it.
  • Classify a vision task by whether it needs appearance cues or metric geometry.
  • Identify changes that require updating K, revalidation, or recalibration.

Key idea

When calibration matters

You need calibration when a program uses pixels to infer geometry. Reading a label, classifying a color, or detecting that an object exists may work without calibration. Measuring a part, placing a virtual object on a table, estimating a robot grasp, and computing stereo depth all require a known relationship between pixels and camera rays.

The first habit is to separate appearance from geometry. A sharp photo can still be geometrically misleading. A slightly noisy photo can still support accurate geometry if the target is visible and the model is valid. Calibration does not guarantee a correct measurement. It records how one camera configuration maps incoming rays to pixel positions.

A pixel coordinate such as column 742, row 318 is only an address in an image. By itself it does not say how far away the object is, how large the object is, whether the lens bent the ray, or whether the frame was cropped before processing. Calibration supplies the missing camera model and the conditions under which that model may be used.

Store the matrix with the information needed to use it safely: image size, distortion model, target geometry, accepted and rejected views, validation results, and limits. A matrix copied into code without that context is easy to misuse.

Vocabulary: Intrinsics describe the camera's ray-to-pixel mapping; pose is an object's rotation and translation relative to a frame. A reprojection residual is a detected pixel minus the pixel predicted by the model. Root-mean-square (RMS) error summarizes residual lengths. A view means one image and its target pose. See the notation bridge before unfamiliar symbols slow you down.

The supplied example outputs let you start without a camera or Python installation. The chapter activities execute Python on this device; the full practice workflow can also be reproduced in a local Python environment. Generated checkerboards test the workflow; they do not calibrate your physical camera.

See it in practice

Example

Suppose a phone app draws a virtual ruler on a table. If the ruler drifts as the camera tilts, the problem is not only rendering. The app is using image positions as if they were stable geometry. Calibration helps by giving the app intrinsics, distortion parameters, and a way to estimate pose from known points. The overlay may still fail if the marker is blurred or if the wrong resolution is used, but the cause becomes easier to diagnose.

Common mistakes

  • Treating calibration as image enhancement instead of geometry.
  • Using a camera matrix after focus, zoom, resolution, or crop changed.
  • Judging the result from one low RMS number.
  • Forgetting to state where the calibration was validated.

When things go wrong

Diagnose the problem

A team ships a measurement feature after testing only the center of the image. It works in the demo because the part never moves. In production the part appears near the lower-left corner, and the reported width changes by several millimeters. The camera did not suddenly become worse; the team used pixel distances as if they were physical distances without checking the camera geometry in the region that mattered.

Treat the feature as a geometry problem, then collect results that show whether the calibration supports that task. The report should say which camera setting was used, which image region was validated, and what visible failure would trigger recalibration. Once the task is written this way, calibration stops being an abstract preprocessing step and becomes part of the measurement chain.

What to check

  • Does the task require measurement, pose, overlay, depth, or comparison across views?
  • Can the result change when the same scene is photographed with a different lens?
  • Has the report stated which camera settings and image regions were validated?
  • Would a non-calibration problem, such as blur or poor lighting, explain the observed failure better?

Predict before revealing: The same feature spans half as many pixels after moving farther away. Can calibration alone recover its size in meters?

Compare your reasoning

No. You still need depth, a known plane or another scale constraint. State that missing input before converting pixel width into a physical size.

Build and test

Python lab

Your investigation

After fixing estimate_width, compare Target at 2 m with Same target at 4 m. Record pixel span and recovered width for each. Explain what extra information lets this program report meters, then name one measurement task where that information would be unavailable.

Fix the conversion so the same target has the same metric width at two depths.

Coordinate geometry reference.

Try it

Apply what you learned

Interpret your results

What can one camera-matrix mismatch demonstrate, and what evidence would you still need before measuring a physical part? Connect your pixel shifts to the application rather than treating a passing function as a calibration certificate.

Transfer check: A red-label classifier and a robot measuring a part both receive a half-size image. Which needs its camera matrix updated, and why?

Check your reasoning

The geometry pipeline needs K scaled to match the new pixels. The classifier may need retraining or preprocessing checks, but color recognition alone does not need metric rays. A known resize needs a coordinate update and verification; a lens or focus change needs a new calibration or validated parameters for that setting.

Compare your results

The target spans 180 px at 2 m and 90 px at 4 m. With focal length 900 px, both give width = pixel_span × depth / focal = 0.400 m. The original function returns 0.200 and 0.100 without the depth factor; these are normalized spans, not widths in meters. Calibration supplies focal length, but this exercise also supplies depth. A single photograph of an unknown object does not generally provide its physical size or depth.

Return to the Python lab

Before you move on

Check your understanding

  • You can recover a known width from pixel span, focal length and supplied depth.
  • You can explain why calibration alone does not determine an unknown object’s size.
  • You can name the camera settings and image region that a measurement must validate.

Run your Python on the supplied inputs and pass its computational checks. Inspect the result and its limits, then mark the lesson complete.