Amy de Lange
Amy de Lange

Reputation: 31

Transform value 3D coordinate pose landmarks (Mediapipe) to real world value in meters?

I already print the results.pose_landmarks.landmark[mp_pose.PoseLandmark.LEFT_WRIST].z but I am not sure what this number represents and how I can transform this to meters. Can someone help me?

Here is part of my code to retrieve z coordinate of the left wrist:

    if results.pose_world_landmarks:
        avg[i] = results.pose_world_landmarks.landmark[mp_pose.PoseLandmark.LEFT_WRIST].z 
        i += 1
        if i == avgerageWindow-1:
            i = 0
            # print('z coordination left wrist' )    
            print(avg.mean())
                
            avg = np.zeros(avgerageWindow)

part of output:

-0.3987021893262863
-0.557043993473053
-0.5094283401966095
-0.5732827246189117
-0.5142240881919861
-0.624730509519577
-0.531936788931489
-0.7728394329547882
-0.9255167961120605

Upvotes: 2

Views: 5024

Answers (1)

mat b
mat b

Reputation: 1

POSE_WORLD_LANDMARKS...I think is what you want!

It gives you real-world 3D coordinates in meters with the origin at the center between hips.

(see https://google.github.io/mediapipe/solutions/pose.html#pose_world_landmarks)

Upvotes: 0

Related Questions