feat(766-1): 다듬기 흐름을 기본으로 — 스위치 SURFACE_REFINE_FLOW 걷음 · 자동 전처리 = 업체 분류 + 다듬기(분류 있음) · 점진 TIN + 다듬기(늘) · 확정 기본 ptd_refine

- resolve_auto_source_filters 가 늘 `_refine` 판을 돌려줌 — 바탕 마스크(업체 분류 · 점진 TIN)는 다듬기 입력으로 그대로 저장(엔진 길 그대로)
- SURFACE_CONFIRM_DEFAULT_FILTER 기본 = ptd_refine · WF1 자동 확정은 엔진이 고른 첫 필터 그대로
- B04 드롭다운 갈래 넷 그대로(관리자 비교용)
- 지킴 시험 고침: test_640_lidar_default · test_b04_ground_filters 의 자동 목록 기대값을 다듬기 판으로 · test_762_1_refine 의 스위치 시험은 스위치가 없어져 「기본 흐름」 시험으로 바꿈

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 15:20:19 +09:00
co-authored by Claude Opus 5.5
parent c82f301e2b
commit 579e337892
5 changed files with 18 additions and 23 deletions
+5 -2
View File
@@ -43,12 +43,15 @@ def test_일부만_분류된_LAS_는_자동_기본에서_ptd() -> None:
partial = np.ones(len(points), dtype=np.uint8)
partial[(points[:, 0] < 30) & (np.arange(len(points)) % 4 == 0)] = 2 # 비율 7 % · 덮임 30 %
assert classified_coverage(_structured(points, partial)) < 0.5
assert resolve_auto_source_filters(_structured(points, partial)) == ["ptd"]
assert resolve_auto_source_filters(_structured(points, partial)) == ["ptd_refine"]
spread = np.ones(len(points), dtype=np.uint8)
spread[::37] = 2 # 비율 2.7 % · 덮임 100 %
assert classified_coverage(_structured(points, spread)) == 1.0
assert resolve_auto_source_filters(_structured(points, spread)) == ["classification", "ptd"]
assert resolve_auto_source_filters(_structured(points, spread)) == [
"classification_refine",
"ptd_refine",
]
def test_덮임은_저장본을_다시_씀(tmp_path: Path) -> None:
+2 -6
View File
@@ -1,11 +1,10 @@
"""762-1 지면점 다듬기(SMRF 꼴) · 제안 흐름 스위치 · 762-2 품질 지표 지킴 시험.
"""762-1 지면점 다듬기(SMRF 꼴) · 766-1 다듬기 기본 흐름 · 762-2 품질 지표 지킴 시험.
합성 비탈(17°) + 능선(높이 6 m · 폭 약 16 m) + 덤불 혹(3 × 3 m · 1.5 m 뜸) — 필터가
덤불까지 지면으로 고른 판 → 다듬기가 혹은 지우고 능선 · 비탈은 남김.
"""
import numpy as np
import pytest
import B04_PreProcess.B04_PreProcess_Engine_Ground as ground
from B04_PreProcess.B04_PreProcess_Engine_Filter_Refine import refine_ground_mask
@@ -51,13 +50,10 @@ def test_refine_never_adds_points() -> None:
assert refine_ground_mask(xyz, np.zeros(len(xyz), dtype=bool)).sum() == 0
def test_refine_flow_switch(monkeypatch: pytest.MonkeyPatch) -> None:
def test_refine_flow_is_default() -> None:
xyz, _, _ = _scene()
bounds = np.array([[0, 120], [0, 120], [0, 50]], dtype=np.float64)
data = {"xyz": xyz, "bounds": bounds, "classification": np.full(len(xyz), 2, np.uint8)}
# 기본 끔 = 지금 길 그대로
assert ground.resolve_auto_source_filters(data) == ["classification", "ptd"]
monkeypatch.setattr(ground, "SURFACE_REFINE_FLOW", True)
assert ground.resolve_auto_source_filters(data) == ["classification_refine", "ptd_refine"]
data["classification"][:] = 0
assert ground.resolve_auto_source_filters(data) == ["ptd_refine"]
+5 -5
View File
@@ -109,13 +109,13 @@ def test_auto_filters_prefer_classification_but_always_build_ptd() -> None:
classified = np.ones(len(points), dtype=np.uint8)
classified[::4] = 2
# 분류가 있으면 classification 이 기본이고, ptd 는 검증용으로 같이 만든다.
# 분류가 있으면 classification 이 기본이고, ptd 는 검증용으로 같이 만든다(둘 다 다듬기 판).
assert resolve_auto_source_filters(_structured(points, classified)) == [
"classification",
"ptd",
"classification_refine",
"ptd_refine",
]
# 분류가 없으면 ptd 하나뿐 — 빈 마스크로 모델을 만들지 않는다.
assert resolve_auto_source_filters(_structured(points, unclassified)) == ["ptd"]
assert resolve_auto_source_filters(_structured(points, unclassified)) == ["ptd_refine"]
assert not has_classified_ground(_structured(points, unclassified))
# classification 이 없는 구조화 데이터(옛 캐시)에서도 죽지 않는다.
assert resolve_auto_source_filters(_structured(points)) == ["ptd"]
assert resolve_auto_source_filters(_structured(points)) == ["ptd_refine"]