feat: unify reference depth calculation by using median-based range factor and baseline

This commit is contained in:
2026-09-16 01:04:59 +08:00
parent 474fc10f0f
commit cf512dc013
6 changed files with 45 additions and 36 deletions

View File

@@ -6,7 +6,7 @@
- **BREAKING**:服务端不再计算参考深度,`depth.json` 只保留 `image_size` 与 `intrinsics`。
- 在 `common/depth.py` 提供唯一的参考深度计算:以 `depth.exr` 的 Alpha 大于 `0.95`、深度有限且为正为有效域,取相机 Z 的 95 百分位。
- 统计前丢弃距离超过 `REFERENCE_DEPTH_LIMIT`(`8` 米)的样本,避免远景把参考深度与整个重建尺度拖到远处;选择后没有样本时参考深度取该上限,不报错也不提示。
- 统计前丢弃距离超过中位数 `REFERENCE_DEPTH_RANGE_FACTOR`(`1.1`)倍的样本,避免远景把参考深度与整个重建尺度拖到远处;完全没有有效像素时参考深度取 `REFERENCE_DEPTH_BASELINE`(`8` 米),不报错也不提示。
- 深度方向拟合没有可用样本时返回无倾斜方向,Relief Plane 与 Depth Symmetry 的 `Direction` 一律回退为 `(0, 0, 1)`,不再报错,也不在调用点各自兜底。
- Depth Plane、Relief Plane、Depth Solid、Depth Symmetry 共用同一实现与同一统计量,不再区分「服务端基准」与「标定基准」;Cutout 把选区作为可选参考域传入,Plane 转换使用整幅深度图。
- **BREAKING**:参考深度从内容中位数改为上分位,基准平面移动到场景后端,Depth Plane 与 Relief Plane 的几何结果随之变化。