3D visionExplainer

Long range stereo depth accuracy with a wide baseline

Stereo depth accuracy falls with the square of distance. The worked error budget for a 6 m boat on a wide-baseline 4K stereo pair, with the arithmetic shown.

LumaSpec Vision10 min read Share on LinkedIn

On this page 10 sections
  1. 01The equation that decides the project
  2. 02Worked example: a 6 m boat at the far range
  3. 03What moves the error, and by how much
  4. 04Pixels on target and the lens decision
  5. 05The blind zone a wide baseline creates
  6. 06Choosing the two cameras
  7. 07Errors you control: trigger, shutter and rigidity
  8. 08Build the pair or buy a 3D sensor
  9. 09Checks before ordering, and the decision
  10. 10Questions

A boat sits 100 m off your shore mount, 2 m tall and 6 m long, and you want its range from two machine-vision cameras on a rigid 2 m bar rather than a packaged 3D sensor. The whole project rides on one line of geometry: depth error grows with the square of range. This guide gives the equation, works it through with the arithmetic shown for a 4K-class pair, shows what moves the error and by how much, and marks the ranges where a wide baseline stops paying and an integrated 3D sensor takes over.

The equation that decides the project

Stereo depth comes from disparity, the shift in pixels of one feature between the two rectified images. Three lines carry everything:

d = B · f_px / Z ΔZ ≈ Z² · Δd / (B · f_px) f_px = f / p

B is the baseline in metres, Z the range in metres, d the disparity in pixels, Δd the disparity error in pixels, f the lens focal length and p the pixel pitch, both in the same unit. The second line is the one to plan around: double the range and each pixel of disparity error costs four times the depth. Only three numbers fight that slope — baseline, focal length in pixels, and how well your matcher interpolates below one pixel. Sizing the baseline itself is its own decision; the guide to choosing a stereo camera baseline distance walks it.

Worked example: a 6 m boat at the far range

Take a concrete pair: 4K-class sensors with 3840 pixels across a 7.7 mm sensor, 3 mm lenses, and the 2 m baseline from the introduction.

Pixel pitch: 7.7 mm / 3840 = 2.0 µm. Focal length in pixels: f_px = 3 × 3840 / 7.7 ≈ 1496 px.

Scale at the target: 1496 px / 100 m ≈ 15 px per metre. The 3 m hull width spans 45 pixels, the 6 m length 90, the 2 m superstructure 30. That is a comfortable detection, not a few-pixel maybe.

Disparity: d = B × f_px / Z = 2 × 1496 / 100 = 30 px, comfortably inside any stereo matcher's search range.

Depth error: ΔZ = Z² / (B × f_px) = 100² / (2 × 1496) = 3.3 m for every pixel of disparity error. Match the hull to 0.2 pixels and the reading holds to 0.2 × 3.3 ≈ 0.67 m; a sloppy 0.5-pixel match costs 1.7 m.

The verdict at that range: detection with margin, metric range to roughly ±0.7 m per matched point, and no route to centimetres — the geometry forbids it. Ranges also come back along the optical axis; a slanted sight line needs the conversion in depth value versus true distance.

What moves the error, and by how much

Four levers sit in the equation; you choose three of them before ordering.

Range Disparity Depth error at 0.2 px
20 m 150 px 0.03 m
50 m 60 px 0.17 m
100 m 30 px 0.67 m
200 m 15 px 2.7 m

(Worked-example baseline, 1496 px focal length; error = Z² × 0.2 / (2 × 1496).)

Doubling the baseline to 4 m halves every number in that column and doubles the disparity at each range. Doubling the focal length to 6 mm does the same through f_px and costs half the field of view. Matching quality is the lever you do not buy: honest sub-pixel results land between 0.1 and 0.5 pixels on textured targets, and smooth sky-water boundaries go first — why distance deforms edges in stereo depth shows where that fails. Frame averaging cuts random error as the square root of the frame count: 30 frames on a slow target buy about a 5× cut, while a calibration bias stays put.

Pixels on target and the lens decision

Detection needs pixels, and the lens sets how many. By similar triangles, scene width at the working range = sensor width × Z / focal length: the 3 mm lens covers 7.7 × 100 / 3 ≈ 257 m and puts 15 px on every metre of hull; a 6 mm lens covers about 128 m and 30 px per metre. More focal length doubles the pixels on the boat and halves the depth error, and it costs field of view — choose from the widest swath you must watch at once. The walkthrough in how to choose a machine vision lens focal length covers the other inputs, and the lenses category is where you filter by focal length and sensor format.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Work your own swath and range through the focal-length calculator:

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

The blind zone a wide baseline creates

The geometry that helps far away hurts up close. Disparity grows as range shrinks, and every matcher has a maximum: Z_min = B × f_px / d_max. With a 256-pixel search that is 2 × 1496 / 256 ≈ 12 m; with 128 pixels, ≈ 23 m. Inside that band the pair returns no depth at all — not worse depth, none. Wide baselines also occlude: each camera sees a different side of a near object, so matching fails on anything with structure within a few baseline lengths. A 2024 IEEE study of wide-baseline matching states the trade plainly: fixed baselines lose accuracy at long distance, wide baselines hit occlusion problems at short distance (IEEE Xplore).

Choosing the two cameras

Build the pair from two identical area scan cameras on one bar: same sensor, same lens, same shutter, one hardware trigger line into both. Mono sensors match slightly better than colour because the matcher skips colour interpolation; either works at these pixel counts.

LS-CMR-0166 is a 12 MP USB3 camera with 4000 × 3000 resolution on a 1/1.7" sensor, the class the worked example assumes.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

MV-CH120-11UC is the 12 MP USB3 alternative with a global shutter, a 1.1" sensor and a C-mount.

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

MV-CH250-90YC-M58S-NN is a 25 MP CoaXPress camera with a global shutter and an M58 mount, for more pixels on target and bandwidth to spare on longer runs.

Area scan camerasHikrobot MV-CH250-90YC-M58S-NN 25 MP Area Scan Camera, CXP-12, GMAX0505, Color, V2, M58-mountMV-CH250-90YC-M58S-NN
Sensor format
1.1"
Lens mount
M58
Interface
CoaXPress
Resolution
Over 25 MP
$10,979.00 · quotedView and quoteBuild a system with it

For packaged wide-baseline hardware rather than parts, the trade-offs sit in wide baseline stereo camera selection for depth mapping.

Errors you control: trigger, shutter and rigidity

Timing first. A boat at 10 knots covers about 5 m per second. If the second camera fires 1 ms late, the hull has moved 5 mm, worth 1496 × 0.005 / 100 ≈ 0.07 px of disparity — about 0.25 m of range at that distance. Ten milliseconds of skew costs 0.75 px and 2.5 m. One trigger signal into both cameras, within a millisecond or two, keeps this at noise level.

Shutter second. A rolling-shutter sensor reads its rows across a frame period, tens of milliseconds at 30 fps; motion during the readout tilts the disparity field row by row. On a fixed shore mast that barely registers; on anything that moves or shakes, the global-shutter camera above earns its place.

Rigidity third, and it is the silent one. A vergence twist of 0.7 mrad — one disparity pixel is 1/1496 rad ≈ 0.67 mrad — biases range by the full 3.3 m per matched pixel. Temperature is gentler: a 2 m steel bar grows 0.7 mm over a 30 °C swing (about 12 ppm/K), a depth bias of 0.7/2000 × 100 ≈ 3.5 cm at the working range, and aluminium roughly doubles it. Centimetres come from the bar; metres come from a bent mount, so calibrate the extrinsics with the rig mounted and check a landmark afterwards. Rectifying a hand-built pair has its own failure modes: fixing horizontal lines in stereo rectification covers camera order and baseline checks, and stereo disparity scale and calibration for depth estimates covers turning disparity into metres.

A shore mount also means salt fog, rain and sun-to-night swings; the housing question is a rating question, and the NEMA 4X versus IP66 ratings guide sorts out which rating a seaside enclosure needs.

Build the pair or buy a 3D sensor

The wide pair earns its keep from roughly 20-30 m outward; that is where packaged sensors run out of geometry. Below a few metres, an integrated 3D sensor is less work: factory geometry, one device, one calibration. Projected light thins out with the square of range and integrated baselines are fractions of a metre, so these sensors own the near band the wide pair cannot cover. The 3D sensors category holds laser profilers, structured-light and ToF classes, and industrial 3D camera selection: stereo, ToF or structured light sorts the three.

MV-DPS200P-02 is a projected structured-light 3D camera, the class built for bench and conveyor ranges.

3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote

Checks before ordering, and the decision

  • Baseline: keep at least 15 px of disparity at the farthest range, B ≥ 15 × Z / f_px. At the far range with 1496 px that floor is 1.0 m; the worked baseline buys margin and half the error.
  • Lens: pick it from the swath you need — 6 mm covers about 128 m and doubles the hull pixels.
  • Cameras: two of one model, global shutter if the mount moves, one hardware trigger line. Plan the trigger wiring with the order, not after.
  • Bar: steel if temperatures swing; calibrate the extrinsics with the rig mounted.
  • Ground truth: confirm the reading against a landmark of known range before trusting it.
  • Near range: if 5-20 m matters too, add a second narrower pair or a close-range 3D sensor.

The decision, case by case:

  • Detect a 6 m boat at the far range and read range to about ±0.7 m: build the worked pair with 4K-class cameras — the arithmetic above carries it.
  • Decimetre accuracy there: move to a 6 mm lens (±0.33 m) and average frames on slow targets; centimetre range needs a different technology, such as a laser rangefinder on the same bearing.
  • Coverage from 5 m to 100 m: two baselines, or one wide pair plus a near-range 3D sensor.

To assemble the pair, start at the camera configurator or the camera finder; the 3D vision topic page collects the rest of the stereo guides.

Questions

Which point on the boat does the stereo range refer to?

Stereo returns depth for every matched pixel, so the reported object range follows the rule you code. The usual convention is the centre of the frontal plane of the 3D bounding box. A hull seen off-axis puts bow and stern at different disparities, and reporting the nearest point makes the reading swing with heading; the bounding-box centre stays stable as the boat yaws.

Can the two cameras be different models?

Keep them identical. Rectified matching assumes the same pixel pitch, focal length and shutter behaviour on both sides; any mismatch shears the disparity field, and the resulting bias grows with the square of range. Buy two of one model, mount them on a single bar, and feed both cameras the same trigger signal.

What frame rate does a moving boat need?

Less than you might expect. At 10 knots a boat covers about 5 m/s, which is roughly 75 pixels per second at the far range with a 1496-pixel focal length. At 15 fps that is 5 pixels of motion per frame, ample for detection and tracking; go to 30 fps only if you also want heading and speed from consecutive frames.

Can one camera measure the range if the boat's size is known?

Yes, approximately. With a known width W, range is Z ≈ f_px × W / w_px. The worked-example hull is 3 m wide and spans 45 pixels at the far range, so Z = 1496 × 3 / 45 ≈ 100 m. One pixel of width error is about 2 m of range there, similar to the stereo error per match; stereo wins when the true width is unknown.

How do I check the calibration on site without a test target?

Use a landmark of surveyed range: a channel marker, pier end or breakwater at 50-100 m. Rectify a frame pair, read the disparity and range, and compare with the survey. The budget at the far range is about 0.7 m for 0.2 pixels of disparity, so a bias beyond that means the extrinsics have moved and the rig needs recalibration on its mount.