fix(mapping): swap L/R joint assignments so the mirrored camera puts the player's right hand in HAND_RIGHT (was landing in HAND_LEFT); matches real Kinect convention. Update golden + occlusion tests.

This commit is contained in:
kinect-bot committed 2026-11-26 23:39:49 -05:00
1 parent 91c4e82ea6
commit cb5e8f7865
2 files changed
+40 -25

No files matched your search

+24 -16
View File
@@ -74,22 +74,30 @@ std::array<MediaPipeLandmark, contract::kJointCount> make_joint_landmarks(
? interpolate(joints[2], ears, 1.3f)
: landmarks[0];
joints[4] = landmarks[11];
joints[5] = landmarks[13];
joints[6] = landmarks[15];
joints[7] = hand_landmark(landmarks, 19, 17, 21, 15);
joints[8] = landmarks[12];
joints[9] = landmarks[14];
joints[10] = landmarks[16];
joints[11] = hand_landmark(landmarks, 20, 18, 22, 16);
joints[12] = landmarks[23];
joints[13] = landmarks[25];
joints[14] = landmarks[27];
joints[15] = landmarks[31];
joints[16] = landmarks[24];
joints[17] = landmarks[26];
joints[18] = landmarks[28];
joints[19] = landmarks[32];
// L/R are SWAPPED relative to MediaPipe's landmark labels because the tracker
// mirrors the camera (selfie view, matching a real Kinect's mirrored depth
// image). On a mirrored frame MediaPipe's RIGHT_* landmarks sit on the
// player's LEFT and vice-versa, so NUI LEFT joints take MediaPipe's right
// indices and NUI RIGHT joints take MediaPipe's left indices. This makes the
// player's right hand land in HAND_RIGHT (joint 11) with +x relative to
// SHOULDER_CENTER, matching real Kinect recordings (HAND_R-SHC.x in
// [-0.35,+0.86]); verified against the live log's moving hand.
joints[4] = landmarks[12];
joints[5] = landmarks[14];
joints[6] = landmarks[16];
joints[7] = hand_landmark(landmarks, 20, 18, 22, 16);
joints[8] = landmarks[11];
joints[9] = landmarks[13];
joints[10] = landmarks[15];
joints[11] = hand_landmark(landmarks, 19, 17, 21, 15);
joints[12] = landmarks[24];
joints[13] = landmarks[26];
joints[14] = landmarks[28];
joints[15] = landmarks[32];
joints[16] = landmarks[23];
joints[17] = landmarks[25];
joints[18] = landmarks[27];
joints[19] = landmarks[31];
return joints;
}