plane_sweep_depth — 3D plane_sweep_stereo op

• 数据种类:image2d × image2d → depth

• 调用: 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'(要直接调用实现,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';从台账取用则 ops3d.get("plane_sweep_depth"))

用法

用 plane-sweep stereo 估计稠密深度图。→ (H,W) depth。

在各深度平面上将 src 扭曲到 ref,逐像素选出 photo-consistency 最小的候选深度(winner-take-all)。所有候选下都在视场外的像素为 NaN。fail-closed(失败即拒绝)(空/非 2D/shape 不一致/非正深度)。

• img_ref / img_src:同形状的 (H,W) 灰度 float。基准相机为 [I|0],source 为 P_src = K [R|t](X_src = R X_ref + t)。

• K:共用的 (3,3) 内参矩阵(奇异时 ValueError)。

• depth_candidates:基准相机坐标下正的有限深度序列(D 个)。返回的深度必定是其中的某一个,量化误差约为候选间隔。候选通常在近处取得较密(按逆深度等间隔)。

• window:代价的 box 聚合尺寸(默认 1 = 逐像素绝对差)。2 及以上时为窗口内 SAD 除以有效像素数归一化后的值,在纹理贫乏区域更稳定,但阶跃会变模糊。小于 1 时 ValueError。

• normal:扫掠平面的法线(默认 (0,0,1) = 正对平行)。

返回值为 (H,W) float。所有候选下都映射到 src 视场外的像素(代价 ∞)为 NaN。在亮度恒定的区域,所有候选的代价相同,argmin 返回第一个候选,因此会混入没有可信度的深度。需要代价体 (D,H,W) 本身时,请使用同一模块的 cost_volume。所得深度可以用 depth_to_points 转换为点云。

背景知识指南(该算子背后的物理与约定)

• depth_sensors — 深度传感器知识 —— 测距原理、实机数值、缺测的表现

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

可运行的示例(实际调用该算子并已验证的样例)

• plane_sweep_depth — py -3.11 examples_3d/plane_sweep_depth.py

类型可衔接的下一个算子(可接受 depth 作为输入)

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

同类别(plane_sweep_stereo)

warp_by_plane


*Provenance: plane_sweep.py — 3D 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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