The depth image looks clean on the bench at half a metre, then falls apart when the same camera moves back to five metres. Nothing is broken: a stereo depth camera's error grows with the square of standoff, so ten times the distance means one hundred times the noise. This page gives you the formula, a worked example you can rerun with your own baseline and focal length, the filter settings that help, and the geometry changes that actually buy accuracy. You will finish able to predict your depth camera's noise at the real working distance and to choose between a shorter standoff, a longer baseline, more pixels or a different sensor class.
Depth error grows with the square of distance
A stereo camera sees each point twice, from two cameras separated by the baseline b, and turns the pixel shift between the two views — the disparity d — into distance:
Here z is the standoff, f is the focal length in pixels (lens focal length divided by pixel pitch), b is the baseline, σd is the disparity noise in pixels and σz is the depth error it produces. The second line is the first differentiated with respect to d: the d² in the denominator becomes z² in the numerator, which is why depth error grows with the square of distance while it shrinks in proportion to baseline and focal length.
Plan on σd ≈ 0.2 px for a matte, well-lit, textured scene; subpixel stereo matching lands in the 0.1–0.2 px range once the matcher has texture to lock onto. Bare metal, glare or starved exposure push disparity noise past 1 px, which multiplies every error figure below by five. Keep b and z in the same unit and f in pixels, or the arithmetic means nothing.
Worked example: the same camera at 0.5 m and at 5 m
Take a compact stereo module: 50 mm baseline, a 1,000 px focal length (a 3 mm lens on 3 µm pixels) and σd = 0.2 px on a matte part. At a 0.5 m standoff the depth error is 0.5² × 0.2 / (1,000 × 0.05) = 0.001 m, or 1 mm. Pull the same camera back to 5 m and the error is 5² × 0.2 / (1,000 × 0.05) = 0.1 m, or 100 mm.
| Standoff z | Depth error σz |
|---|---|
| 0.5 m | 1 mm |
| 1 m | 4 mm |
| 2 m | 16 mm |
| 3 m | 36 mm |
| 5 m | 100 mm |
The optics never changed between the first row and the last; the standoff did. That is why an accuracy figure stated at one distance carries nothing to another distance. Work from baseline, focal length and disparity noise, and compute the error at your own standoff before you compare cameras.
What post-processing can and cannot fix
Start with what filters cannot do. No preset file, JSON configuration or firmware setting changes f, b or z, so there is no download that makes a camera accurate at 5 m when the geometry puts 100 mm of noise there. What filters earn is the removal of out-of-range data and random noise from the pixels you keep.
Set the threshold filter first, and set it to the part, not to the scene. A part at 2.0 m with 200 mm of depth extent wants a minimum around 1.9 m and a maximum around 2.2 m; the floor, the fence and the wall behind the part are then excluded before any statistic, point cloud or pick plan sees them. The sample programs that ship with stereo SDKs wire the processing blocks together — start from one and put the threshold block first. If you would rather set the limit in code, the disparity shift guide to setting a minimum range in your script shows it done.
Smoothing comes after thresholding, with honest limits. Spatial smoothing trades resolution for a calm-looking image, and at long standoff the edges are already deformed by the geometry — the guide on why distance deforms stereo edges shows the mechanism — so smoothing cannot bring them back. Temporal averaging cuts random noise in proportion to the square root of the frame count while camera and part stand still, and does nothing for systematic error such as edge fattening. For a full pipeline, the stereo depth map noise guide turns raw depth into usable data; the guide on depth values that jump on a still scene covers the noise sources themselves; and the noisy point cloud fixes guide groups thresholds, sensing mode and depth range in one place.
Two more habits keep the long-range map honest. Slice the working volume: many SDKs let you confine processing to a depth band, and scanning in fixed layers keeps every frame inside its own slice, as the one-inch z-layer ROI configuration for depth cameras shows. And keep one depth scale from sensor to inspection: threshold in the stream's native units and rescale the depth output only afterwards — resolving depth output scaling in the camera matrix is the reference for where that scaling goes wrong.
The geometry levers, ranked by payoff
- Shorten the standoff. Error scales with z², so this is the strongest lever by far: moving the part from 2 m to 1 m cuts the error from 16 mm to 4 mm, and from 5 m to 2.5 m cuts it from 100 mm to 25 mm. Mount the camera as close as the field of view allows.
- Lengthen the baseline. Doubling b halves the error: 50 mm to 100 mm at a 2 m standoff turns 16 mm into 8 mm. The limits are optical (wider baselines need wider lenses so both views still overlap) and mechanical (the two cameras must stay rigidly fixed to one another). The guide to choosing stereo camera baseline distance works the trade, and the wide-baseline selection guide and the long-range accuracy article with a wide baseline cover the metre-class cases.
- Raise the focal length in pixels. A longer lens or finer pixels double f and halve the error at the same standoff — 1,000 px to 2,000 px turns 16 mm into 8 mm at 2 m — at the price of a narrower field of view.
- Feed the matcher texture. Disparity noise is the multiplier you control every day: 0.2 px on a patterned, matte part against 1 px on shiny bare metal is a five-fold error difference at the same standoff. Project a pattern, kill the glare and hold the exposure in range; the lighting guide for stereo depth accuracy separates sunlight, which helps, from glare, which hurts.
| Lever | Move | Depth error at 2 m |
|---|---|---|
| Standoff | 2 m → 1 m | 16 mm → 4 mm |
| Baseline | 50 mm → 100 mm | 16 mm → 8 mm |
| Focal length | 1,000 px → 2,000 px | 16 mm → 8 mm |
| Disparity noise | 0.2 px → 1 px | 16 mm → 80 mm |
Which sensor class fits your standoff and tolerance
Stereo is one family inside the 3D sensors category; the other families obey different geometry. Match the class to the tolerance before you open the camera finder:
- Areal height maps close in. Projected structured-light stereo supplies the texture itself, so disparity noise stays low and the square law works for you:
- Type
- Stereo / structured light
- Profile sections at metres. Laser profilers triangulate a projected laser line with large effective baselines and high-resolution sensors, so they hold millimetre-class profiles at standoffs where a stereo depth camera shows centimetres:
- Type
- Laser profiler
- Dimensioning and volume at metres, centimetre class. Time-of-flight accepts a larger per-metre error and pays you back in range and speed, and a galvanometer-steered laser stereo camera covers the middle ground where the spot must land on a chosen region of the part:
- Type
- Stereo / structured light
- Type
- Depth / ToF camera
The 3D vision topic page collects the rest of the depth guides, including minimum-range behavior and mounting.
When the usual answer is wrong
If the part never stops, stop thinking in frames. Line-scan 2.5D systems build the map one encoder-synced line at a time and hold profiling accuracy across a moving web: the MV-HLVS-16K100-L60 pairs 16K resolution with a 120 kHz sampling rate and a 600 mm emitting area length.
- Type
- 2.5D inspection
If the job is presence, count and volume at 3–6 m, do not chase millimetres at all: a centimetre-class camera at the right standoff beats a millimetre-class camera you cannot mount close enough. And at very long standoff the matcher starts losing weak edges altogether — the guide on box edges vanishing at long standoff shows the case — so change the class before the geometry changes the answer for you.
Checks before you order
- Compute the error at your real standoff from your own baseline, focal length and disparity noise before comparing cameras; the worked example above is the template.
- Bench-test at the mounting position: aim at a flat matte target, capture a 30-frame burst and read the standard deviation of depth across the central area; that figure is your true σz. The mean offset against a gauge block is the separate systematic error.
- Check texture under production lighting, not bench lighting; glare and bare metal multiply disparity noise by five in a hurry.
- Set the threshold band to the part alone and confirm the background pixels are gone from the point cloud before any measurement runs.
- If the computed error still misses tolerance with the longest baseline you can mount, change the sensor class; do not plan on a filter closing a geometry gap.
The decision
Compute first, then act on the size of the gap. Within tolerance: add the threshold filter at the part's depth band and stop. Over by up to four times: shorten the standoff, the one lever that scales as the square. Over by about two: double the baseline or the focal length in pixels. Noise that jumps between scenes: fix texture and glare before touching the mount. When no mount gets close enough, the geometry has spoken — a laser profiler for profiles at metres, projected structured light for areal maps close in. Start the selection at the camera configurator, or send the working distance and tolerance through the contact page and we will check the error budget with you.
Questions
Why is my depth map clean at 0.5 m but noisy at 5 m?
The disparity your camera measures shrinks as the part moves away. With the example module it is 100 pixels at 0.5 m and 10 pixels at 5 m, so the same 0.2 pixel matching error grows from 0.2 percent of disparity to 2 percent, and depth error follows the square of the standoff: from about 1 mm to about 100 mm.
Can a post-processing filter or preset file make depth data accurate at long range?
No. Filters rearrange or discard pixels; they cannot add the baseline or focal length the geometry never had. The one that earns its place at distance is the threshold filter set to the working range, because it stops background pixels from reaching your statistics. Watch the costs of the rest: spatial smoothing blurs genuine surface steps, temporal averaging smears moving parts, and hole filling invents pixels where the matcher found none.
How much does doubling the stereo baseline improve depth accuracy?
Depth error is inversely proportional to the baseline, so doubling it halves the error at the same standoff: with the example module, going from 50 mm to 100 mm turns 16 mm of error at 2 m into 8 mm, and 100 mm at 5 m into 50 mm. The practical limit is overlap: twice the baseline needs lenses roughly twice as wide, or the two cameras stop sharing enough scene to match.
How many frames does temporal averaging need to cut depth noise?
Random depth noise falls with the square root of the frame count while camera and part stand still: 16 frames cut it about four times, 100 frames about ten times. A moving part smears the average instead of converging, and systematic error such as edge fattening does not shrink with averaging at all. Burst-capture a static target, then apply the result only to static inspections.
What depth error should I expect at 10 m?
Apply the square law to the worked example: 10² × 0.2 / (1,000 × 0.05) = 0.4 m, so around 400 mm of depth noise from the same compact module that resolved 1 mm at 0.5 m. At that range stereo stops being a measuring instrument; use time-of-flight or a logistics depth camera for presence and volume, or bring the measurement to the part with a laser profiler.




