Lenses & opticsApplication note

Liquid lens focus sequences for traffic image capture

Step a liquid lens through a preset focus sequence, one position per frame, so every vehicle on the lane is sharp, and open the iris for brighter night images.

LumaSpec Vision10 min read Share on LinkedIn

On this page 9 sections
  1. 01Why does one focus position fail across a traffic lane?
  2. 02How do you size the focus steps for a toll lane?
  3. 03How fast can a liquid lens step focus?
  4. 04Why open the iris instead of raising gain?
  5. 05Which camera, lens and lighting run the sequence?
  6. 06How do you trigger and time the sweep?
  7. 07When is a focus sequence the wrong answer?
  8. 08What do you check before ordering?
  9. 09Questions

A traffic camera covering a toll lane, a car park entry or a junction faces two demands that pull against each other: every vehicle across a 5–45 m band should be sharp, and night plates need short exposures with the iris wide open. Stopping the iris down to buy depth of field throws away the light. A liquid lens breaks the deadlock: the host lens stays at F2.8 and locked at infinity while a controller sweeps the liquid element through a preset focus sequence, holding each position for one frame. A step settles in about 10 ms, so a 30 fps camera keeps pace. This guide sizes the steps with depth-of-field arithmetic, times the sweep against your frame budget, and shows when one focus position is still the right answer.

Why does one focus position fail across a traffic lane?

Focus tolerance is a band, not a road. A 16 mm lens at F2.8, judged at a one-pixel blur circle, focused at 6 m is sharp from 4.9 m to 7.8 m, so a vehicle at 12 m arrives already outside it.

Depth of field comes from three numbers: focal length f, f-number N, and the blur circle you accept, c. On the 12 MP camera of this example, one pixel is about 3.45 µm — roughly 4,000 pixels across the ~14 mm width of the 1.1" format — so set c = 3.45 µm.

H = f² / (N × c) f and c in mm, H in mm s_near = H × s / (H + s − f) s_far = H × s / (H − s + f)

At F2.8 the hyperfocal distance is H = 16² / (2.8 × 0.00345) = 256 / 0.00966 ≈ 26,500 mm, about 26.5 m. Focused at 6 m, the sharp band runs 4.9–7.8 m; focused at 10 m, it runs 7.3–16.0 m. No single position covers a 5–14 m lane at this criterion.

The traditional fix is to stop down. At F11, one position covers 3.7 m to infinity, but diffraction blurs every point by 2.44 × 0.55 µm × 11 ≈ 14.8 µm — about 4.3 pixels, the width of a plate stroke you are trying to read — and the scene receives 15× less light than at F2.8. Stopping down cures aberrations right up to where diffraction takes over, the trade set out in stopping down and optical aberrations, but a 4-pixel blur floor is softness by design.

Depth of field around the focus plane Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.depth of fieldfocus planeapertureoutside it, pointsblur into circleswide aperture: steep cone, shallow zonesmall aperture (high F#): deeper zone
Depth of field around the focus plane. Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.
Approach Iris Light vs F2.8 Blur at best focus Coverage of a 5–14 m lane
One position, stopped down F11 ×1/15 4.3 px, diffraction only 3.7 m–∞, soft everywhere
One position, wide open F2.8 ×1 1.1 px 6.2–11.5 m, both ends soft
Two focus steps, wide open F2.8 ×1 1.1 px 4.9–16.0 m, sharp

How do you size the focus steps for a toll lane?

Place one step at the nearest band and one at the middle. At 6 m and 10 m with a 16 mm F2.8 lens, the two bands join into 4.9–16.0 m of sharp coverage, which contains every position on a 5–14 m toll lane.

The worked example, arithmetic included:

  • Geometry. 12 MP on the 1.1" format gives about 4,000 × 3,000 pixels at 3.45 µm. The horizontal field is 2 × arctan(13.8 mm / 32 mm) = 46.7°.
  • Hyperfocal. H = 16² / (2.8 × 0.00345) = 256 / 0.00966 ≈ 26.5 m.
  • Step 1 at 6 m. Near = 26.5 × 6 / (26.5 + 5.98) = 159 / 32.5 = 4.9 m; far = 159 / 20.5 = 7.8 m.
  • Step 2 at 10 m. Near = 265 / 36.5 = 7.3 m; far = 265 / 16.5 = 16.0 m.
  • Union. 4.9–16.0 m, so the 5–14 m lane sits inside the sequence with margin at both ends.

Exposure comes from motion, not taste. At 12 m the ground pixel is 2 × 12 m × tan(23.3°) / 4,000 = 10.3 m / 4,000 = 2.6 mm. Budgeting half a pixel of smear at 50 km/h (13.9 m/s): 1.3 mm / 13.9 m/s ≈ 94 µs, so set 100 µs and accept 1.39 mm, about 0.5 pixels, of smear. The vehicle spends 9 m / 13.9 m/s = 0.65 s in the band, roughly 19 frames at 30 fps, so each step fires about ten times per pass and you keep the sharpest frame per step downstream.

Depth of field and diffraction
Units
Depth of field
– mm
About the focus plane
– mm
Diffraction limit
– F/#
Blur limit
– µm
Diffraction spot
– µm
At this F-number
–

DOF ≈ 2 × N × c × (1 + m) / m², c = allowed blur × pixel size. Diffraction spot (Airy disk) ≈ 2.44 × wavelength × N × (1 + m); past the diffraction limit it is larger than the blur you allowed.

Browse lenses by aperture and format Open the full calculator

How fast can a liquid lens step focus?

A full-range liquid-lens step settles in roughly 10 ms. One focus change therefore fits inside a single 33.3 ms frame at 30 fps, and a two-step sweep costs two frames, not two seconds.

Makers quote the 10 ms figure for a full-range step; smaller steps settle sooner. Budget one frame per step: settle, then the 100 µs strobed exposure, then readout, all inside the 33.3 ms period. A six-preset sweep spans six frames, 200 ms — still inside the 0.65 s the toll-lane vehicle spends in range. Where distance changes continuously rather than vehicle by vehicle, such as a conveyor or a pick cell, the same hardware runs closed-loop instead of presets; that mode is the subject of the liquid lens autofocus guide for changing working distances.

Why open the iris instead of raising gain?

The iris multiplies photons and gain multiplies noise with them: stepping F5.6 to F2.8 collects 4× the light and doubles the shot-noise-limited SNR, while 4× gain at F5.6 leaves SNR exactly where it was.

The worked example needs 100 µs at night, and only the aperture puts photons in those microseconds. Amplifying the signal four times amplifies shot and read noise by the same four, so the recorded SNR is unchanged; opening from F5.6 to F2.8 is two stops, and SNR improves by about 6 dB. That is why the sequence opens the iris to the diffraction budget — about F2.8 at 550 nm, or F4 at 850 nm, where blur is 8.3 µm, about 2.4 pixels — and lets the focus steps buy back the depth of field. If your camera runs auto exposure, cap it: capping the maximum auto exposure time is the motion-blur guard this lane needs, and the iris-versus-gain logic is the same as in automatic iris, exposure and gain control.

Which camera, lens and lighting run the sequence?

Three parts set the ceiling: a global shutter camera so the moving plate does not skew, a host lens whose iris opens to F2.8, and a strobe-capable controller that pulses light only inside the microsecond exposure window.

Browse area scan cameras by shutter type; the camera finder filters format and interface. The toll-lane camera is a 12 MP global-shutter USB3 model on the 1.1" format:

Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
Interface
USB3
Resolution
12 MP
$2,339.00 · quotedView and quoteBuild a system with it

The host optic is a 16 mm lens covering the 1.1" format with an F2.8-22 iris and under 0.3% distortion; browse machine vision lenses by image circle and iris range. The liquid element sits behind the C-mount host, just before the sensor, so framing never moves between steps.

Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it

Continuous lamps cannot make a microsecond-scale night exposure pay; pulsed LED lighting driven by a strobe controller can:

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

The LS-CTL-0070 pulses a 24 V output across four channels at 200 W and is set over RS232; compare light controllers by strobe feature and channel count against your lane count.

How do you trigger and time the sweep?

Write the focus presets once, then let one trigger repeat the cycle step, settle, strobe, expose: with 10 ms settle and 100 µs exposure the whole cycle fits inside every frame, 30 times a second, for as long as the vehicle stays in range.

Two control patterns cover every install. Hardware: load the presets once and let a trigger input step through them — deterministic, no command latency. Software: one command per step over Ethernet or serial — flexible, at the cost of a few milliseconds per step. Downstream, each frame is sharp at one band, so per vehicle you keep the frame whose step matched its range; capturing an image set from one trigger makes that a routine rather than a hack. The 100 µs pulse is also far shorter than the 20 ms period of 50 Hz mains light, so strobed night lanes sidestep the banding explained in the flicker-versus-exposure fix.

When is a focus sequence the wrong answer?

When one position already covers the geometry: a 16 mm F2.8 lens focused at 25 m is sharp from 12.9 m to 436 m, so a 13–45 m gantry view needs no sequence at all — set the focus once and spend the effort on light.

Decision rule: compute H for your focal length, aperture and blur criterion, then look for one focus distance s_f with s_near at or below the nearest vehicle and s_far at or beyond the farthest vehicle, or simply s_f ≥ H, where the far limit runs to infinity. If such a position exists, one focus wins: fewer frames, no controller, no per-step calibration to trust.

The sequence earns its parts when the lens is long. A 200 mm plate-crop lens at F2.8 has H ≈ 4,140 m, and at a 30 m focus its band is 29.8–30.2 m, about ±0.2 m. There, presets every 5 m from 30 m to 60 m track the vehicle frame by frame: it covers 5 m in 0.36 s, about eleven frames at 30 fps, so each preset holds for a burst. The liquid-lens power each range needs follows the auxiliary-lens rule:

P = f / s P in dioptres, f and s in metres

16 mm at 5 m needs 0.0032 dpt, almost nothing, which is why short lenses barely load the element. 200 mm at 30 m needs 6.7 dpt and at 60 m needs 3.3 dpt, so the sweep is 3.4 dpt of travel. Check that span against the liquid lens's rated range before you promise the coverage.

What do you check before ordering?

Match formats and budgets, then bench-test the sweep: the four checks that decide are sensor format under the host lens's coverage, dioptre span against the nearest range, settle time against the frame period, and strobe sync against the exposure.

  • Format match. The host lens's image circle must cover the sensor: a 1.1" lens on a 1.1" sensor; anything smaller crops corners.
  • Diffraction budget. Open the iris only to where blur stays near 2 pixels: F2.8 at 550 nm (3.8 µm), F4 at 850 nm (8.3 µm).
  • Dioptre span. P = f/s at the nearest range: 0.0032 dpt at 16 mm and 5 m; 6.7 dpt at 200 mm and 30 m.
  • Settle vs frame period. 10 ms inside 33 ms at 30 fps leaves margin; at 60 fps, give each step two frames.
  • Shutter. Global shutter for moving plates; rolling shutter skews them.
  • Strobe sync. The controller's strobe output must gate the light inside the 100 µs window; a 4-channel 24 V unit covers one lane.
  • Lock the host at infinity. The scheme assumes the prime never drifts, so lock the focus ring once set — the lens locking screws guide covers what the locks hold.
  • One temperature sweep. Controllers that apply the element's stored calibration correct thermal drift; still, step through the presets on a target once in afternoon heat and once after dark to confirm each band lands.

Size the chain in the lens configurator, or send us the lane drawing and we will run the bands with you.

Questions

Can I mount the liquid lens in front of the host lens instead of behind it?

You can, but framing shifts with focus. In front, the element changes the system's effective focal length, so the field of view breathes between steps and the vehicle drifts across the frame. Behind the lens, near the sensor, framing stays fixed and only the focus plane moves, which is what a sequence assumes. Keep the prime locked at infinity and let the liquid element own every range change.

Does the liquid element soften the image between focus steps?

It adds a small aberration of its own, largest wide open. The honest test is one frame at your working aperture with the element flat and one with it driven, compared on a plate crop; if sharpness drops, close the iris half a stop and re-test. The host lens's published distortion, under 0.3% in the example, still governs geometry at every step.

How many frames does a four-step sweep cost at 30 fps?

One per step when settle fits the frame period: 10 ms of settle inside 33 ms leaves margin, so four frames span about 133 ms. At 50 km/h that is 1.85 m of travel between the first and last frame, so space the presets no closer than the bands they must separate.

Why not lengthen the exposure instead of opening the iris?

Motion caps the exposure first. At 50 km/h a 1 ms exposure smears the plate about 13.9 mm, more than five ground pixels at 12 m in the worked example, while the 100 µs setting holds smear near half a pixel. The iris adds photons without adding smear; gain adds brightness without photons.