Lens Effects That Break a Calibration: Focus, Heat, Shock, Filters, Shutters and Blur
A calibration is a measurement of one lens, in one state, at one moment. Anything that changes the lens-to-sensor geometry afterwards changes the true intrinsics, and the stored numbers silently go stale. Other effects do not move the lens at all but corrupt the measurement itself, so the calibration is wrong from the start.
This page goes through both kinds. The worked examples use the illustrative camera from how a lens forms an image: 1280 × 800 pixels at 3.0 µm pitch, and a 2.0 mm f/2.0 lens, so f_px = 666.7 px.
Focus changes the intrinsics
Section titled “Focus changes the intrinsics”In the pinhole model of a lens camera, the “focal length” is really the distance from the lens to the sensor. At infinity focus, that equals the focal length. Focused closer, the lens sits further out (see the thin-lens equation), so the calibrated f_px grows. To the best of our knowledge, refocusing also shifts the principal point slightly and changes the distortion, because a real lens does not travel perfectly along its axis and its aberrations vary with object distance.
Worked example: a few degrees of turn on an M12 lens
Section titled “Worked example: a few degrees of turn on an M12 lens”An M12 lens (also called an S-mount lens) is a small lens with an M12 × 0.5 thread. Lens maker Commonlands explains that it is focused “by threading the entire lens in or out of its holder while watching a live image, then locking the barrel once the target distance is sharp.” One full turn moves the lens 0.5 mm along the axis.
Refocus our 2.0 mm lens from infinity to 0.5 m:
| Quantity | Value |
|---|---|
| Lens travel needed | 8.0 µm |
| Thread rotation for that travel | 8.0 / 500 × 360° = 5.8° |
| f_px before | 2.000 mm / 0.003 mm = 666.7 px |
| f_px after | 2.008 mm / 0.003 mm = 669.3 px |
| Change | 0.40 % |
| Shift of a point 640 px from the centre | 640 × 0.0040 = 2.6 px |
A rotation of under 6 degrees moves edge points by 2.6 pixels. For comparison, the calibrations in the double sphere paper report mean reprojection errors of about 0.13 to 0.23 pixels for the best-fitting models. A focus nudge too small to notice by eye is ten times larger than a good calibration’s error.
Autofocus, optical and electronic stabilisation
Section titled “Autofocus, optical and electronic stabilisation”- Autofocus moves the lens, or a group inside it, whenever the scene changes. The intrinsics move with it.
- Optical image stabilisation (OIS) shifts a lens element or the sensor during the exposure to cancel shake. That moves the principal point, frame by frame.
- Electronic image stabilisation (EIS) crops and warps each frame in software. The pixel grid no longer matches the sensor, so no fixed calibration describes it.
Android’s camera API shows how seriously phone makers take this. For devices that support it, it reports “an array of intra-frame android.lens.intrinsicCalibration updates”, adding: “Although OIS could be the main driver, all relevant factors such as focus distance and focal length must also be included.” In other words, the intrinsics are not constant even within one frame. A measuring camera turns all three off, as the camera calibration guide explains.
Thermal focus shift
Section titled “Thermal focus shift”Thermal focus shift (thermal defocus) is the movement of best focus as the lens and its mount warm up or cool down. Commonlands describes three simultaneous mechanisms: the barrel and spacers “expand or contract by their coefficient of thermal expansion (CTE)”, the “glass refractive index shifts with temperature, a property called dn/dT”, and “The glass elements themselves change radii and thickness, which alters their optical power.”
The coefficient of thermal expansion (CTE) is the fractional change in length per degree, usually given in ppm/°C (parts per million per degree Celsius). Commonlands gives “roughly 23 ppm/°C” for an aluminium barrel “against 7–9 ppm/°C for optical glass”.
Worked example: a warm aluminium holder
Section titled “Worked example: a warm aluminium holder”Suppose 5 mm of aluminium separates the lens seat from the sensor plane, and the camera warms by 30 °C between calibration and use (for example, from a cool bench to a running head unit in a warm room):
ΔL = 5 mm × 23 × 10⁻⁶ /°C × 30 °C = 3.45 µmThat alone uses more than half of our lens’s ±6 µm depth of focus (f/2.0, c = 3 µm). It also stretches the lens-to-sensor distance by 0.17 %, which moves a point 640 px from the centre by about 1.1 px.
This is the mechanical term only. Whether the optical terms add to it or cancel it depends on the design. Commonlands: “Its direction is design-dependent, set by a given lens’s materials and element positions, not a universal rule.” Its practical point applies directly to calibration: “The magnitude of focus shift scales with the temperature swing from the calibration point.”
Meta’s Aria documentation lists the same effect among the causes of calibration drift: “Temperature variations affecting optical parameters”.
So calibrate at the temperature the camera runs at. Let a head-worn camera reach its normal operating temperature before capturing calibration images, and record that temperature with the calibration.
Plastic and glass lenses
Section titled “Plastic and glass lenses”Many small lenses are hybrids that mix glass with moulded plastic elements. Commonlands: “Optical glass has lower thermal expansion and a more stable refractive index than optical polymer, so all-glass designs tend to hold focus better across temperature”. It is careful to add that construction is only a first filter: “Thermal suitability comes from measured focus and MTF over temperature on the full lens, holder, and sensor assembly”. An athermal lens is one designed so these effects largely cancel; in Commonlands’s words, “thermal drift has been intentionally reduced, not eliminated”.
Mechanical shock and lens-holder stability
Section titled “Mechanical shock and lens-holder stability”A focused lens is only as stable as what holds it. Commonlands: “A focused lens that is not locked will drift under vibration.” It lists three ways to lock an M12 lens:
- a lock ring against the holder face, which “stays re-focusable”;
- a set screw, “which can introduce tilt if overtightened”;
- a thread adhesive. Anaerobic thread lockers “cure only where air is excluded and the surface catalyzes them, so inactive metals and plastic holders need an activator.”
It also warns that “Some thermoplastics craze under anaerobic chemistry. Confirm focus before it cures.” Any of these is a one-way door for the calibration: calibrate after the lens is locked and the adhesive has cured, never before.
The frame between cameras matters as much as each lens. A stereo pair’s extrinsics are only as stable as the structure between the two sensors. Meta’s documentation for its Aria glasses lists “Mechanical deformation when worn by different users” among the reasons calibration parameters drift from their factory values; the camera calibration guide covers how per-session calibration handles it.
Sensor tilt
Section titled “Sensor tilt”If the sensor is not exactly perpendicular to the optical axis, one side of the image is focused slightly in front of the sensor and the other slightly behind it. One edge is sharper than the opposite edge, and the geometry gains a small perspective component.
OpenCV can model it. Its tilted-sensor model, with parameters τx and τy, exists because “The tilt causes a perspective distortion”. For diagnosis, Commonlands notes that uneven corner sharpness has several possible causes, and that “a tilted sensor or target can produce a similar focus mismatch” to field curvature. Compare opposite corners: if one side is consistently softer, suspect tilt.
Vignetting and relative illumination
Section titled “Vignetting and relative illumination”The image is darker toward the edges. Lens makers call the brightness at the edge relative to the centre the relative illumination. Vignetting is the part of that falloff caused by light being physically blocked, for example by the lens barrel or a hood.
For an ideal rectilinear lens, the natural falloff follows approximately cos⁴θ, where θ is the angle off axis:
| Angle off axis | cos⁴θ |
|---|---|
| 20° | 0.78 |
| 30° | 0.56 |
| 45° | 0.25 |
| 60° | 0.06 |
Commonlands is careful about this rule: “Cosine-fourth models that roll-off only to first order under rectilinear projection. It is not a law.” Fisheye projections, pupil aberrations and the sensor’s own angular response all move the real curve.
Many cameras correct the falloff digitally. Android, for example, exposes a “lens shading” map: “a low-resolution floating-point map that lists the coefficients used to correct for vignetting, for each Bayer color channel.”
What it does to calibration:
- Dark corners are noisy corners. With less light, the target’s edges have less contrast relative to the noise, and the detected corner positions scatter more. That falls exactly where the distortion is strongest and needs the best data.
- Do not fix it with overexposure. Raising exposure until the corners are bright can clip the white squares in the centre. A clipped edge loses the brightness gradient that sub-pixel corner refinement relies on. Light the target evenly and set exposure for the edges without clipping the centre.
Chromatic aberration
Section titled “Chromatic aberration”Glass bends different wavelengths by different amounts. Commonlands describes the two forms: “Axial chromatic aberration means different wavelengths focus at different distances. Lateral chromatic aberration means they form images at different sizes, so color edges shift apart away from the center.”
- Axial (longitudinal) colour changes the best focus with wavelength. A lens focused under white light can be soft under a coloured or near-infrared light.
- Lateral colour changes the magnification with wavelength. On a colour sensor, the red, green and blue images of a target corner land in slightly different places, more so toward the edge.
A geometric calibration is therefore, strictly, a calibration for the spectrum it was captured under. Calibrate under the same kind of illumination the camera will record in. A monochrome sensor does not escape it: Commonlands notes that “A monochrome sensor can still record chromatic blur because it collects a range of wavelengths.”
MTF and resolution falloff toward the edges
Section titled “MTF and resolution falloff toward the edges”The modulation transfer function (MTF) describes how much contrast a lens keeps at each level of detail. Commonlands: “MTF is the ratio of image modulation to object modulation for a sinusoidal pattern at a stated spatial frequency.” Detail is measured in line pairs per millimetre (lp/mm) on the sensor.
The finest pattern a sensor can sample along a row is its Nyquist frequency:
Nyquist (lp/mm) = 1000 / (2 × pixel pitch in µm)For 3.0 µm pixels, that is 167 lp/mm.
Lens MTF often falls toward the edge of the image, from field curvature, astigmatism and other off-axis aberrations. Commonlands: “Field curvature and astigmatism can soften off-axis detail”.
Why it matters for calibration: a corner detector locates a corner from the brightness gradients around it. A softer image spreads those gradients, so the corner is located less precisely, and the softest region is again the edge, where the distortion terms are decided. Two practical consequences:
- Choose target squares large enough that the edge blur is small compared with a square, even at the edge of the image and at the far end of the working distance.
- Check sharpness at the edges before calibrating. A lens that is soft in the corners at the calibration distance will give noisier corner points there, whatever the model.
IR-cut filters and infrared illumination
Section titled “IR-cut filters and infrared illumination”Many colour cameras have an IR-cut filter, a coated glass plate that blocks near-infrared light. Some cameras switch it out at night and use infrared illuminators, commonly at 850 nm or 940 nm.
Two separate effects move the focus.
- The plate itself. A flat glass plate in the converging beam pushes the focus back. Commonlands gives the paraxial formula
shift ≈ t × (1 − 1/n), where t is the plate thickness and n its refractive index: “For t = 1mm and n = 1.52, shift ≈ 0.34mm (340μm) away from the lens.” That is far larger than our lens’s ±6 µm depth of focus. Removing, adding or swapping a filter changes the focus, so it changes the intrinsics. - The wavelength. Most lenses are colour-corrected only across visible light. Commonlands: “Most standard lenses are corrected across the visible band only, so they defocus when illumination switches to NIR”. And “Removing an IR-cut filter does not fix this.”
For calibration:
- Calibrate with the exact filter stack the camera will record with. A calibration made with the IR-cut filter in place does not describe the camera with it removed.
- Calibrate under the wavelength the camera will use. If recordings are lit by an 850 nm illuminator, calibrate under 850 nm, or use a lens corrected for both bands.
Rolling shutter and global shutter
Section titled “Rolling shutter and global shutter”The shutter type is a timing effect that becomes a geometric one when anything moves.
- Global shutter: Basler’s documentation says “all of the sensor’s pixels start exposing at the same time and also stop exposing at the same time.”
- Rolling shutter: “the camera exposes the pixel rows one after the other, with a temporal offset” (Basler calls it t_Row) from one row to the next. Basler gives the total sensor readout time as t_Row multiplied by the image height in rows.
When the camera or the target moves, each row sees it at a slightly different moment, and the image skews. Basler: “This is due to the temporal shift between the start of exposure of the individual rows.”
Worked example: rolling-shutter skew
Section titled “Worked example: rolling-shutter skew”Suppose a rolling-shutter version of our camera reads out top to bottom in 10 ms, and the head turns at 100°/s:
rotation during readout = 100 °/s × 0.010 s = 1.0°skew at the image centre ≈ 1.0° × 11.6 px/° = 11.6 pxThe bottom row is displaced by about 12 pixels relative to the top row. A calibration target captured this way is distorted by motion, and the solver will try to explain that distortion with lens parameters.
For calibration: hold the camera and target still for each image (or use a global-shutter camera, or a rolling-shutter-aware method). Oth, Furgale, Kneip and Siegwart showed that the line delay can itself be calibrated from video of a known pattern, noting that structure from motion on rolling-shutter images “requires the usual intrinsic parameters such as focal length and distortion coefficients as well as accurate modelling of the shutter timing.”
Motion blur and exposure time
Section titled “Motion blur and exposure time”While the shutter is open, a moving image smears. The blur length in pixels is roughly:
blur (px) ≈ angular rate (°/s) × exposure time (s) × pixels per degreeWorked example: how short must the exposure be?
Section titled “Worked example: how short must the exposure be?”At the image centre our camera gives 11.6 px per degree. For a head turning at 100°/s:
| Exposure time | Blur at the image centre |
|---|---|
| 10 ms | 11.6 px |
| 5 ms | 5.8 px |
| 2 ms | 2.3 px |
| 1 ms | 1.2 px |
To keep the blur under one pixel, the exposure must be below 1 / (100 × 11.6) s ≈ 0.86 ms. On a rectilinear lens the edges need more, because pixels per degree grow toward the edge (22.5 px per degree at 44° off axis on our lens).
For calibration images, blur shifts and smears the corners. When the target or camera moves during capture, as in camera–IMU calibration, Kalibr’s guide asks to “keep the motion blur low” with short exposures and good light. The camera calibration guide has the rest of that recipe.
Lock these before you calibrate
Section titled “Lock these before you calibrate”| Lock | Why | How to check |
|---|---|---|
| Focus | Any focus change moves f_px, the principal point and distortion. | Mark or lock the lens; confirm sharpness at the working distance first. |
| Autofocus, OIS, EIS | Each changes the intrinsics frame by frame. | Turn them off in firmware; confirm the output resolution matches the sensor mode. |
| Lens lock and adhesive cure | A loose or curing lens drifts. | Calibrate only after the thread locker or adhesive has fully cured. |
| Operating temperature | Thermal focus shift scales with the difference from calibration. | Warm the camera to its running temperature; record it. |
| Filter stack | Adding or removing a plate shifts the focus. | Calibrate with the exact filters used in recording. |
| Illumination spectrum | Chromatic aberration moves focus and scale with wavelength. | Calibrate under the recording illumination (visible or IR). |
| Sensor mode and resolution | Binning, cropping or a new mode changes the pixel grid. | Calibrate in the exact mode used for recording. |
| Exposure | Too long blurs; clipped highlights bias corners. | Short exposure, even light, no clipping at the centre. |
| Shutter timing | Rolling-shutter skew looks like distortion. | Keep target and camera still per image, or use an RS-aware method. |
| Mechanical frame | Stereo extrinsics depend on it. | Final assembly only; no parts changed after calibration. |
Sources
Section titled “Sources”- Commonlands, What is an M12 lens?: focusing and locking M12 lenses, glass and hybrid lenses.
- Commonlands, Ruggedized machine vision lenses: thermal focus shift mechanisms, CTE figures and athermal design.
- Commonlands, IR corrected lenses for machine vision: focus shift with wavelength and filter plates.
- Commonlands, Lens aberrations in machine vision: chromatic aberration, field curvature and tilt.
- Commonlands, How to read MTF curves: MTF definition and the Nyquist formula.
- Commonlands, Lens chief ray angle and mismatch: the cosine-fourth caveat.
- Android Developers, CaptureResult: intra-frame lens intrinsics samples and the lens shading map.
- Basler, Electronic shutter types: global and rolling shutter timing.
- OpenCV, calib3d module documentation: the tilted-sensor model.
- Oth, L., Furgale, P., Kneip, L. and Siegwart, R. (2013). Rolling shutter camera calibration. IEEE CVPR.
- Usenko, V., Demmel, N. and Cremers, D. (2018). The double sphere camera model. 3DV: reported reprojection errors.
- Kalibr, camera–IMU calibration guide, ETH Zurich ASL.
- Meta Project Aria, online calibration: causes of calibration drift.