3D visionExplainer

Why stereo depth images have an invalid band at the edges

Why stereo depth cameras return no depth near the image edges, how the invalid band grows with distance, and how to plan working distance and mounting.

LumaSpec Vision9 min přečíst Sdílet na LinkedIn

Na této stránce 9 sekce
  1. 01What the invalid band actually is
  2. 02Why the band grows with object distance
  3. 03Distinguishing the band from other black regions
  4. 04Planning around the band
  5. 05Sensor types and the band
  6. 06Measuring the band on your own camera
  7. 07Handling invalid pixels in software
  8. 08Checklist before you mount
  9. 09Questions

Every stereo depth camera has a strip along the left and right edges of its depth image where the depth values are invalid. The pixels are there, usually black or zero-filled, but no measurement exists behind them. No parameter, exposure setting or firmware update will fill them in. This is geometry, not a fault. Understanding where that band comes from tells you how wide it will be at your working distance, why you cannot crop it once and forget it, and how to mount the camera so your parts never land in the blind zone.

What the invalid band actually is

A stereo depth camera triangulates: it finds the same feature in the left and right infrared images, measures how far the feature shifted between them (the disparity), and converts that shift to distance. Triangulation is only possible where a surface point is visible to both sensors at once.

The two sensors sit a baseline apart, typically tens of millimetres. Each sensor has its own field of view, and the two cones overlap only in a wedge-shaped region in front of the camera. Inside the wedge, both sensors see the surface and depth exists. On the left edge of the scene, the right sensor's view starts further right than the left sensor's, so there is a strip of the left image the right sensor cannot see; on the right edge, the mirror image of the same problem. In those strips disparity cannot be computed, so the depth image carries an invalid value. This is closely related to the effect covered in depth image field of view: why stereo coverage is smaller, which looks at the overall coverage loss rather than the edge band specifically.

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.

Why the band grows with object distance

The overlap wedge narrows with distance in absolute terms but, crucially, the band measured in pixels gets wider as the object gets further away. A nearby surface point is seen by both sensors across most of the image width; the parallax between the two views is large and the non-overlapping strips are thin. Move the same surface away and the two views become more similar, so a larger fraction of the image falls in the region one sensor cannot reach.

You can estimate the band from the geometry. If the horizontal field of view of each sensor is θ, the baseline is B, and the surface is at distance Z, the shift between the two sensor views is approximately:

edge_shift = B / Z (radians) band_fraction = edge_shift / θ band_pixels = band_fraction × image_width

Worked example: a camera with a 90-degree horizontal field of view (about 1.57 rad), a 50 mm baseline, and a 1280-pixel-wide depth image, viewing a wall at 1 m:

edge_shift = 0.05 / 1.0 = 0.05 rad band_fraction = 0.05 / 1.57 ≈ 0.032 band_pixels ≈ 0.032 × 1280 ≈ 41 pixels

At 2 m the same camera gives roughly 82 invalid pixels per side, at 4 m about 164. That is exactly why camera makers cannot crop the band in firmware: any fixed crop is wrong for every distance except one. Keeping the full image with invalid flags lets your software adapt. The values above are an estimate; each sensor's datasheet states the guaranteed overlap at reference distances, and that is the number to design against.

Distinguishing the band from other black regions

Invalid edge pixels are often mistaken for a defect, and not every black region in a depth map is the band. Check the pattern:

  • Fixed columns at the left and right edges, present in every frame regardless of scene: the overlap band. It shrinks for near surfaces and grows for far ones, but never disappears entirely.
  • Black fringes along object silhouettes: occlusion. One sensor sees background the other cannot, typically on the side of a part away from the baseline. On moving parts this shows up as trailing shadows, covered in black shadows on fast-moving objects in depth maps.
  • Black holes on dark or shiny surfaces mid-image: the matcher failed to find the feature in both images, a texture or exposure problem rather than geometry.
  • An entirely black frame on one infrared stream: a sensor or illumination fault, not overlap — see stereo infrared camera black image: isolate the cause.

If you can rotate the camera slightly and the black columns stay glued to the image edges at the same widths for the same scene distances, it is the band.

Planning around the band

Because the band cannot be removed, you plan for it. The goal is that every surface you need to measure stays inside the valid overlap at every distance you will actually run, including part-placement tolerance.

  1. Get the guaranteed overlap specification from the sensor datasheet at a reference distance, or measure it yourself (next section).
  2. Scale it to your shortest and longest working distances using the formula above; design for the worst case.
  3. Convert the worst-case band from pixels to millimetres at the sensor: band_mm = (band_pixels / image_width) × horizontal_field_of_view_mm.
  4. Add your part-placement tolerance and a safety margin (10-20% of the band is reasonable) to define a safe measurement rectangle.
  5. Verify that every region of interest in your inspection or measurement code lies inside that rectangle — the pixel-to-3D mapping in bounding box depth: mapping image pixels to 3D points inherits the same validity limits.
  6. If the safe rectangle is too small for your part, either shorten the working distance, choose a wider-field lens option, or move to a sensing technology without a stereo baseline.

For choosing a sensor in the first place, the 3D sensors category covers the main sensing types, and the camera finder filters them by type and resolution.

Sensor types and the band

Not every depth camera behaves the same way at the edges:

Sensing type Edge invalid band Why
Passive or active stereo Widest, grows with distance Baseline geometry: each sensor's view is offset
Projected structured light (stereo receiver) Similar to stereo, sometimes asymmetric Depth needs pattern, projector and receivers to overlap; one edge can be worse
Time-of-flight Narrowest Illumination and observation share nearly the same optical axis; edges lose data mainly to vignetting
Laser profiling (triangulation) Band along the line, not the image Profile width is set by laser line and sensor geometry at the working distance

Structured-light stereo sensors such as the MV-DLS300P-04, a laser galvanometer stereo camera, and the MV-DPS200P-02, a projected structured-light 3D camera, both triangulate between separated optical paths, so their depth frames carry the same kind of edge band. A time-of-flight unit like the MV-DT01WMU avoids the stereo baseline entirely, which is one reason to prefer ToF when your part must reach the image edge at long range.

3D sensorsHikrobot MV-DLS300P-04 Laser galvanometer stereo cameraMV-DLS300P-04
Type
Stereo / structured light
$16,579.00 · quotedView and quote
3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote

When a band-free edge matters more than stereo-class accuracy, that trade is worth making explicitly rather than discovering it after installation.

Measuring the band on your own camera

If a datasheet overlap figure is not to hand, measure it:

  1. Mount the camera squarely facing a flat, textured target (a printed texture works) at your minimum working distance.
  2. Capture a depth frame and find, for the left edge, the first column from the left whose depth values are valid across most of the column height; record its index. Repeat from the right edge.
  3. Move the target to your maximum working distance and repeat.
  4. Use the larger of the two measurements per side, plus margin, as your crop boundary.

Expect the far-distance measurement to be the binding one. Also note that a lens change or a different resolution mode changes the pixel width of the band, so re-measure after any optical change — the same caution applies when you change 3D camera depth resolution and field of view at capture time.

Handling invalid pixels in software

Treat the band as data, not noise:

  • Read the sensor's invalid-value convention (zero, maximum range, or NaN) and check for it before any averaging, filtering or meshing — averaging a real 800 mm reading with an invalid sentinel produces garbage silently.
  • If you crop, crop based on the measured band at the current working distance, not a constant, or gate crops on distance when your line has multiple standoffs.
  • Never upsample or inpaint the band before measurement; the missing disparity is not recoverable from that frame. Cropping at the source, as covered in camera ROI cropping at the source: reduce bandwidth before the host, saves processing but does not create depth where none was captured.

Checklist before you mount

  • Worst-case (longest) working distance identified, with tolerance
  • Overlap band measured or read from the datasheet at that distance
  • Band converted to millimetres on the sensor and compared against part size
  • Every measurement region of interest inside the safe rectangle
  • Camera height and angle chosen so parts cannot drift into the band under placement variation
  • Software checks invalid values before computing on depth pixels

If your measurement keeps colliding with the band no matter the mounting, the honest options are a shorter working distance, a different sensing type, or two cameras covering the scene from offset positions. The stereo depth camera calibration: target capture and stream setup guide is the next step when you go the two-camera route, and you can always run your distances and part sizes through the system configurator or ask us through the contact page for a sensor recommendation.

Otázky

Can I crop the invalid band out of the depth image?

You can crop the image, but the band width changes with object distance, so a fixed crop only works at a roughly fixed distance. At one working distance the band might be 40 pixels wide; at double the distance it can be nearly twice as wide. Measure the band at your shortest and longest real part distance and use the worst case, or better, keep all measurement regions inside the guaranteed overlap.

Why do the depth image and the infrared images have the same resolution if part has no data?

Manufacturers keep the depth frame the same size as the infrared frames for pipeline consistency: alignment, registration and texture mapping all assume matching pixel grids. Pixels outside the overlap are simply marked invalid (often zero or a reserved sentinel value) rather than removed. Your code should treat those values as no-data, not as a zero distance.

Does a shorter baseline remove the invalid band?

No, it only narrows it. The band exists because each sensor sees a slightly different scene; the smaller the baseline, the closer the two fields of view and the narrower the missing strip. But a shorter baseline also reduces depth precision at range, since depth error grows roughly with the square of distance over baseline. Choose the baseline for the accuracy you need, then plan around the band that results.

Do structured-light or ToF depth cameras have the same edge problem?

Projected structured-light stereo cameras have a similar constraint: depth exists only where the projector pattern and both sensors overlap, so edges can lose data there too. Time-of-flight cameras illuminate and observe through nearly the same aperture, so their invalid edges are usually much narrower and caused by lens vignetting rather than geometry. Check the vendor's field-of-view specification for each sensing type before mounting.

How do I check where the safe measurement area ends?

Place a flat, textured target at your shortest and at your longest working distance, capture depth frames, and mark the columns at each edge where depth first becomes valid. That gives you the band width at both extremes. Then verify that every region of interest you measure, including tolerance for part placement, sits inside the valid columns at the worst-case distance.