diff --git a/data_only_viz/arkit_skeleton.py b/data_only_viz/arkit_skeleton.py index 656a45a..5eedc54 100644 --- a/data_only_viz/arkit_skeleton.py +++ b/data_only_viz/arkit_skeleton.py @@ -23,6 +23,9 @@ def arkit_segments(arr2d, valid, parents, max_len: float = 0.5, bounds: float = parents: parent index per joint (-1 = root). max_len: maximum bone length in normalized units; bones longer than this are skipped (garbage coords during ARKit tracking loss). + Caveat: on an extreme close-up (subject filling the frame) a + legit bone can approach 0.5 — raise ARKIT_BONE_MAX live if + the skeleton visibly loses bones when very near the camera. bounds: margin outside [0,1] that is still accepted; endpoints outside [-bounds, 1+bounds] in x or y are rejected. """ diff --git a/data_only_viz/tests/test_arkit_skeleton.py b/data_only_viz/tests/test_arkit_skeleton.py index f31c6f7..7a14525 100644 --- a/data_only_viz/tests/test_arkit_skeleton.py +++ b/data_only_viz/tests/test_arkit_skeleton.py @@ -80,3 +80,16 @@ def test_segments_in_bounds_endpoint_passes(): parents = [-1, 0] segs = arkit_segments(arr2d, valid, parents, bounds=0.1) assert len(segs) == 1 + + +def test_segments_legacy_diagonal_bone_now_filtered(): + """Regression pin: the pre-filter test fixtures used a full-diagonal + bone (0,0)->(0.5,0.5), length ~0.707. The max_len=0.5 default now + REJECTS it — this is the intended behavior change of the v2 filter, + made explicit here instead of silently retuning old fixtures.""" + arr2d = [(0.0, 0.0), (0.5, 0.5)] + valid = [True, True] + parents = [-1, 0] + assert arkit_segments(arr2d, valid, parents) == [] + # ...and the env-tunable knob restores it for close-up shots. + assert len(arkit_segments(arr2d, valid, parents, max_len=0.8)) == 1