3D visionExplainer

Depth map from a single image: what can you measure?

Learn what a depth map from a single image can measure, why metric scale is ambiguous, and when calibrated stereo or a 3D sensor is needed.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01Decide what kind of depth you need
  2. 02Why one image does not uniquely determine distance
  3. 03How calibrated stereo converts disparity into depth
  4. 04Work through depth sensitivity and image sampling
  5. 05Choose the acquisition method that supplies the missing data
  6. 06Treat catalog candidates as starting points, not complete systems
  7. 07Verify the acquisition data before judging the algorithm
  8. 08Know when the usual answer is wrong
  9. 09Questions

A photograph records image coordinates and brightness, not the distance associated with every pixel. That distinction matters when you want to measure a recess, locate a part, or convert an image into a point cloud. Software can predict a plausible surface from one image, but plausible geometry is not automatically a dimensional measurement. For inspection and automation buyers, the first decision is whether the task needs relative depth, constrained geometry, or independently validated distances in physical units.

Decide what kind of depth you need

A depth map assigns a depth value to each valid image location. Before choosing software or hardware, define what those values must represent.

  • Relative depth: which visible surfaces appear nearer or farther away.
  • Metric depth: distance in physical units within a defined coordinate system.
  • Surface height: displacement from a reference plane or fitted surface.
  • Range: distance along a viewing ray, which is not necessarily the same as camera-axis depth.

These outputs are not interchangeable. A colorized prediction may support scene segmentation without providing trustworthy dimensions. Conversely, a calibrated measurement system may return sparse or invalid pixels while still measuring visible surfaces usefully.

For a single ordinary image with no additional information, general metric reconstruction is underdetermined. Choose monocular inference when approximate scene structure is sufficient. Choose calibrated geometric acquisition when the acceptance decision depends on distance or height, then validate its uncertainty against the task.

The companion explanation of monocular reconstruction scale ambiguity covers why reconstruction coordinates can have an arbitrary scale. Here, the purchasing question is which additional information makes the required measurement possible.

Why one image does not uniquely determine distance

An ideal pinhole camera projects a three-dimensional point onto an image according to:

u = fx × X / Z + cx v = fy × Y / Z + cy

Here, X, Y and Z describe the point in camera coordinates. The focal lengths fx and fy are expressed in pixels, while cx and cy locate the principal point.

Multiply X, Y and Z by the same positive factor, and both image coordinates remain unchanged. A small object nearby and a proportionally larger object farther away can therefore produce the same projected outline.

Knowing the camera intrinsics does not remove this ambiguity. Intrinsics describe how rays map onto pixels; they do not identify where an unknown surface lies along each ray. Brightness also depends on illumination, reflectance and surface orientation, so shading alone does not generally resolve the missing geometry.

Monocular depth models use learned scene relationships to estimate that geometry. Some predict relative depth; others predict distances intended to be metric under their training and camera assumptions. Neither output should be accepted as dimensional evidence without application-specific validation.

Additional constraints can change the answer:

  • A known plane and calibrated camera pose can map image positions onto that plane.
  • Known object geometry can support pose estimation and distance calculation.
  • Multiple views with known camera motion can supply geometric constraints.
  • A calibrated projected pattern can encode information absent from an ordinary photograph.

Each method adds information. None establishes that arbitrary metric depth was recoverable from the original image alone.

How calibrated stereo converts disparity into depth

Stereo observes the scene from two separated viewpoints. After calibration and rectification, corresponding points ideally lie on matching image rows. Their horizontal coordinate difference is disparity.

For a standard rectified stereo arrangement:

d = u_left − u_right Z = f × B / d

The focal length f and disparity d must use consistent pixel coordinates. The baseline B and resulting depth Z use the same length unit. The baseline is the separation between camera projection centers, not the gap between housing edges.

Depth is inversely proportional to disparity. Large disparity usually indicates a nearby surface; small disparity indicates a distant surface. Zero disparity does not represent a valid finite distance in this simplified model.

This calculation requires the focal length associated with the rectified images. If images are resized or cropped, update the calibration mapping accordingly. The guide to camera intrinsic parameter conversion explains why parameters must match the image coordinates being processed.

Rectification itself does not create metric scale. An uncalibrated image pair may support projective reconstruction, but physical dimensions require metric information and suitable calibration. For the acquisition procedure, use stereo target calibration and stream setup. The separate guide to live stereo rectification addresses applying that calibration to incoming images.

Also define the measurement origin. Camera-axis depth is not automatically distance from a machine datum or a fixture face. See choosing where stereo Z is measured from before comparing depth values with mechanical dimensions.

Work through depth sensitivity and image sampling

Consider an illustrative rectified stereo system with a focal length of 800 pixels and a baseline of 60 mm. These are application assumptions, not specifications for the products below.

At a disparity of 40 pixels:

Z = 800 pixels × 60 mm / 40 pixels Z = 1,200 mm

Changing the disparity by one pixel changes the calculated distance noticeably:

Disparity Calculated camera-axis depth
39 pixels About 1,231 mm
40 pixels 1,200 mm
41 pixels About 1,171 mm

A useful first-order estimate of depth uncertainty from disparity uncertainty is:

sigma_Z ≈ Z² × sigma_d / (f × B) At Z = 1,200 mm and sigma_d = 0.25 pixels: sigma_Z ≈ 1,200² × 0.25 / (800 × 60) sigma_Z ≈ 7.5 mm

This estimate excludes calibration error, mechanical drift, correspondence failures and other contributors. It is not a complete accuracy specification. It does show why distant surfaces become harder to measure precisely with a fixed baseline and focal length.

Lateral sampling is a different calculation. If an image spans 200 mm across 2,000 pixels, the nominal sampling at that reference plane is:

Object sampling = 200 mm / 2,000 pixels Object sampling = 0.10 mm per pixel Pixels across a 0.50 mm feature = 0.50 / 0.10 Pixels across the feature = 5

The field of view depends on the optics and working distance, as shown below. On a surface with varying depth, object sampling also varies across the scene.

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.

Use the resolution calculator to check feature sampling, not to predict depth accuracy. Five pixels across a feature does not establish that its height can be measured accurately.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Choose the acquisition method that supplies the missing data

The useful comparison is not simply one camera versus two cameras. It is whether the acquisition provides enough independent information for the measurement.

Method Additional information Suitable starting point Main limitation
Single-image inference Learned appearance and scene priors Approximate scene layout or segmentation Scale and local geometry require validation
Calibrated planar measurement Known plane and camera geometry Locations or dimensions on one plane Points away from the plane violate the mapping
Calibrated passive stereo Two viewpoints, baseline and calibration Textured visible surfaces Occlusion, weak texture and matching ambiguity
Structured-light acquisition Calibrated projection and camera geometry Surfaces where projected texture is useful Visibility, surface response and acquisition sequence
Time-of-flight acquisition Calibrated light-propagation measurement Range acquisition across an image Multipath, mixed pixels and technology-dependent limits
Laser profiling Calibrated laser-plane geometry Cross-sections and scanned surfaces Coverage depends on scanning and relative motion

Browse area scan cameras when you need to build a custom imaging arrangement. Use 3D sensors when evaluating a device that incorporates depth acquisition. Both routes can begin in the camera finder, but they require different acceptance tests.

A custom stereo pair gives you control over baseline, optics and image processing. It also leaves you responsible for synchronization, calibration stability, correspondence quality and measurement validation.

An integrated sensor can reduce some integration work, but its output still needs interpretation. Confirm whether it supplies camera-axis depth, radial range, point coordinates, surface height, or another representation. Request definitions for invalid values, confidence indicators, coordinate frames and units.

Treat catalog candidates as starting points, not complete systems

The MV-CU020-90GC is listed as a global-shutter area scan camera. It is a candidate to assess when selecting cameras for a custom geometric acquisition system, not evidence that any proposed pair is synchronized or calibrated.

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
Up to 3 MP
$309.00View partBuild a system with it

Before selecting a pair, confirm documented trigger behavior, exposure timing, timestamp interpretation, lens compatibility and access to calibration-quality images. A global shutter addresses within-frame exposure geometry, but does not by itself synchronize separate cameras.

The MV-DPS200P-02 is listed as a projected structured-light camera. Evaluate it as a different acquisition route rather than assuming it is interchangeable with a passive stereo arrangement.

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

For a structured-light candidate, request the documented measurement volume, acquisition timing, surface restrictions, output formats and accuracy conditions. The catalog identification alone does not establish that the device meets a particular tolerance.

For either route, ask for representative data from surfaces and geometries similar to yours. A nominally dense point cloud can still contain unreliable boundaries or missing regions. An attractive visualization is not an acceptance report.

Verify the acquisition data before judging the algorithm

Preserve enough information to reproduce a measurement. A depth image without its units, calibration and coordinate definition is difficult to audit.

For calibrated stereo, retain:

  • Original left and right images with frame association and acquisition timing.
  • Intrinsic parameters and distortion models for both cameras.
  • The relative camera transformation and baseline units.
  • Rectification mappings and the processed image dimensions.
  • Disparity representation, including any fixed-point scaling and invalid-value convention.
  • Depth or point-cloud coordinates with their origin, axes and units.
  • Processing settings and calibration identifiers.

For an integrated sensor, retain the vendor-documented equivalents and any available confidence or validity output. Do not assume that every invalid pixel uses zero, or that every depth array uses the same unit.

A practical validation sequence uses a stable reference plane and independently measured steps or separations. Capture repeated observations at several positions within the intended working volume. Compare mean error, repeatability, missing-data rate and behavior near boundaries separately.

Test motion separately from static geometry. Poor frame association can produce a plausible but incorrect reconstruction of moving objects. Document which acquisition and processing settings produced each validation result.

Know when the usual answer is wrong

More pixels do not automatically solve poor depth precision. Pixel count can improve sampling, but depth performance also depends on geometry, correspondence, calibration and surface visibility.

A larger stereo baseline is not always preferable. It increases disparity at a given distance, but can reduce common visibility and increase occlusion. Select it against the required working volume rather than maximizing it without constraints.

A second camera is unnecessary when every relevant point lies on a known plane and the required output is planar position. Conversely, a planar mapping cannot measure an unknown recess simply because its boundary is visible.

A learned estimate can be useful when approximate structure is enough. Do not reject it merely because it is inferred; reject unsupported measurement claims when the task requires traceable dimensions.

Before ordering, complete this short checklist:

  • Define the required output: ordering, range, camera-axis depth or datum-relative height.
  • State the working volume, smallest relevant feature and allowable measurement error.
  • Identify the information that establishes physical scale.
  • Confirm acquisition timing and behavior on moving parts.
  • Specify calibration, units, invalid values and coordinate transforms.
  • Agree on validation targets and acceptance criteria before comparing candidate hardware.

Start a custom imaging selection in the camera configurator. For help choosing between a camera pair and an integrated sensor, send the working volume, surface examples and tolerance requirements through application support.

Questions

Can a depth map from one photograph provide millimeter measurements?

A model can assign predicted distances to a single photograph, but those values are not automatically reliable measurements. Physical scale must come from additional information, such as known geometry, a calibrated reference plane, or validated model assumptions. Check accuracy on representative objects before using predicted depth for dimensional acceptance.

What is the difference between disparity and depth?

Disparity is the coordinate difference between corresponding points in a stereo image pair. Depth is a geometric distance calculated using disparity and calibration. In a standard rectified arrangement, depth equals focal length multiplied by baseline and divided by disparity, using consistent coordinates and units.

Are two identical cameras enough to build a measuring stereo system?

A matched camera pair is only part of the system. You also need appropriate optics, stable mounting, calibration, suitable acquisition timing and reliable correspondence processing. Confirm documented synchronization options and validate the assembled system across its intended working volume rather than relying on matching model numbers.

When should you choose an integrated 3D sensor instead of custom stereo?

An integrated sensor may simplify acquisition and provide documented depth outputs, calibration tools and validity information. Custom stereo offers more control over geometry and processing. Compare both against surface visibility, motion, working volume and validated measurement error; neither approach is automatically the better dimensional instrument.