Refactor depth reference handling and cleanup

- Unified reference depth calculation to use a single implementation in common/depth.py.
- Removed server-side reference depth computation and adjusted depth.json to only include image_size and intrinsics.
- Updated depth texture handling to ignore transparent, invalid, and non-positive pixels when calculating reference depth.
- Changed reference depth calculation to use the 95th percentile of valid depth values.
- Adjusted depth direction fitting to return a flat direction when no samples are available.
- Removed cleanup threshold parameters from Cutout and related nodes, simplifying the interface.
- Updated tests to verify new reference depth logic and ensure compatibility with existing functionality.
This commit is contained in:
2026-09-15 22:50:16 +08:00
parent 94130ff38f
commit 2dfa9b2add
37 changed files with 665 additions and 639 deletions

View File

@@ -8,7 +8,7 @@ import numpy as np
from tests.support.nodes import CUTOUT_BUILDERS
def surface(*, step=6.0, size=1.0, resolution=2, wrapper=False):
def surface(*, step=6.0, size=1.0, resolution=2):
bpy.ops.wm.read_factory_settings(use_empty=True)
group = CUTOUT_BUILDERS["DEPTH_SOLID"]()
# Two columns with a complete depth jump along their common boundary.
@@ -70,8 +70,6 @@ def surface(*, step=6.0, size=1.0, resolution=2, wrapper=False):
("Boundary Smooth", 0),
):
set_value(name, value)
if wrapper:
set_value("Cleanup Threshold", 0.0)
return obj, set_value