Skip to content

Commit

Permalink
Fix mp_pose example 2D points having incorrectly interpreted depth (#…
Browse files Browse the repository at this point in the history
…2034)

* fix mp_pose demo - made up depth values are problematic now since there's no camera set

* fix formatting
  • Loading branch information
Wumpf authored May 4, 2023
1 parent 85b46ca commit 8b17bf5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/python/mp_pose/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ def read_landmark_positions_2d(
return None
else:
normalized_landmarks = [results.pose_landmarks.landmark[lm] for lm in mp.solutions.pose.PoseLandmark]
# Log points as 3d points with some scaling so they "pop out" when looked at in a 3d view
# Negative depth in order to move them towards the camera.
return np.array(
[(image_width * lm.x, image_height * lm.y, -(lm.z + 1.0) * 300.0) for lm in normalized_landmarks]
)
return np.array([(image_width * lm.x, image_height * lm.y) for lm in normalized_landmarks])


def read_landmark_positions_3d(
Expand Down

0 comments on commit 8b17bf5

Please sign in to comment.