feat: improve fist grab depth tracking

This commit is contained in:
Tom Boullay
2026-04-29 10:52:35 +02:00
parent d9fc9d0a15
commit fffabc01c2
2 changed files with 14 additions and 5 deletions
+6 -4
View File
@@ -76,15 +76,17 @@ class HandTracker:
result.hand_landmarks,
result.handedness,
):
index_tip = landmarks[8]
palm_center = self._average_points(
[landmarks[0], landmarks[5], landmarks[9], landmarks[13], landmarks[17]],
)
is_fist = self._is_fist(landmarks)
handedness = handedness_categories[0]
hands.append(
HandData(
x=index_tip.x,
y=index_tip.y,
z=index_tip.z,
x=palm_center["x"],
y=palm_center["y"],
z=palm_center["z"],
landmarks=[
{"x": point.x, "y": point.y, "z": point.z}
for point in landmarks