plane_sweep_depth — 3D plane_sweep_stereo op

• Data kinds: image2d × image2d → depth

• Call: import fullseye as fs; fs.ledger.plane_sweep_depth(img_ref: 'np.ndarray', img_src: 'np.ndarray', K: 'np.ndarray', R: 'np.ndarray', t: 'np.ndarray', depth_candidates, window: 'int' = 1, normal=(0.0, 0.0, 1.0)) -> 'np.ndarray' (to call the implementation directly, import plane_sweep; plane_sweep.plane_sweep_depth(img_ref: 'np.ndarray', img_src: 'np.ndarray', K: 'np.ndarray', R: 'np.ndarray', t: 'np.ndarray', depth_candidates, window: 'int' = 1, normal=(0.0, 0.0, 1.0)) -> 'np.ndarray'; from the registry, ops3d.get("plane_sweep_depth"))

Usage

Estimate a dense depth map by plane-sweep stereo. → (H,W) depth.

Warps src to ref for each depth plane and picks, per pixel, the candidate depth with the minimum photo-consistency cost (winner-take-all). Pixels outside the field of view for all candidates are NaN. fail-closed (empty / non-2D / shape mismatch / non-positive depth).

• img_ref / img_src: (H,W) grayscale float of the same shape. The reference camera is [I|0], the source is P_src = K [R|t] (X_src = R X_ref + t).

• K: shared (3,3) intrinsic matrix (ValueError if singular).

• depth_candidates: sequence of positive finite depths (D of them) in reference-camera coordinates. The returned depth is always one of these, and the quantization error is about the candidate spacing. The standard practice is to sample candidates finely at near range (equally spaced in inverse depth).

• window: box aggregation size of the cost (default 1 = per-pixel absolute difference). With 2 or more it becomes the in-window SAD normalised by the number of valid pixels, which is stable in texture-poor regions but blurs steps. Below 1 raises ValueError.

• normal: normal of the sweep plane (default (0,0,1) = fronto-parallel).

The return value is (H,W) float. Pixels that map outside src's field of view for all candidates (cost ∞) are NaN. In regions of constant luminance all candidates tie in cost and argmin returns the first candidate, so depths without confidence get mixed in. When you need the cost volume (D,H,W) itself, use cost_volume in the same module. The resulting depth can be turned into a point cloud with depth_to_points.

Background guides (the physics and conventions behind this op)

• depth_sensors — Depth sensors — ranging principles, real-device figures, how dropouts appear

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• plane_sweep_depth — py -3.11 examples_3d/plane_sweep_depth.py

Ops the type connects to (they accept depth as input)

depth_to_points · tsdf_from_depth · to_points · fuse_to_voxel · depth_to_organized_points · normals_from_depth · occlusion_edges · bearing_angle_image

Same category (plane_sweep_stereo)

warp_by_plane


*Provenance: plane_sweep.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.