Test pose-aware next-view recommendations
Browse files- tests/test_core.py +10 -1
tests/test_core.py
CHANGED
|
@@ -105,7 +105,16 @@ def test_next_view_plan_is_deterministic_and_prefers_gaps():
|
|
| 105 |
plan = next_view_plan(1)
|
| 106 |
assert len(plan) == 5
|
| 107 |
assert plan[0]["gap_from_existing_deg"] >= plan[-1]["gap_from_existing_deg"]
|
| 108 |
-
assert all(item["reason"] == "largest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
|
| 111 |
def test_orbit_projection_rotates_points_without_nan():
|
|
|
|
| 105 |
plan = next_view_plan(1)
|
| 106 |
assert len(plan) == 5
|
| 107 |
assert plan[0]["gap_from_existing_deg"] >= plan[-1]["gap_from_existing_deg"]
|
| 108 |
+
assert all(item["reason"] == "largest observed azimuth gap" for item in plan)
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def test_next_view_plan_uses_observed_camera_centers_when_available():
|
| 112 |
+
camera_to_world = np.eye(4, dtype=np.float32)
|
| 113 |
+
camera_to_world[:3, 3] = [1.0, 0.0, 0.0]
|
| 114 |
+
world_to_camera = np.linalg.inv(camera_to_world)
|
| 115 |
+
plan = next_view_plan(1, np.asarray([world_to_camera], dtype=np.float32))
|
| 116 |
+
assert plan[0]["yaw_deg"] == 270.0
|
| 117 |
+
assert plan[0]["gap_from_existing_deg"] == 180.0
|
| 118 |
|
| 119 |
|
| 120 |
def test_orbit_projection_rotates_points_without_nan():
|