mediapipeFacegeometryPython icon indicating copy to clipboard operation
mediapipeFacegeometryPython copied to clipboard

Rotation convention

Open DikshaMeghwal opened this issue 3 years ago • 3 comments

I am trying to understand the rotation convention followed in the library to convert the transformation matrix to euler angles. It would be super grateful if you could provide some documentation on the convention used for the rotation matrix like handedness, what are the x/y/z axes?

DikshaMeghwal avatar Feb 10 '23 20:02 DikshaMeghwal

This issue might help you, https://github.com/google/mediapipe/issues/1379#issuecomment-752534379

Otherwise checkout the cv2 'handedness', that information should be available online somewhere. From the cv2 handedness you can infer the mediapipe handedness with the link above. If you have the cv2 rotation matrix correct then you can use the following link for a way to get the Euler angles: https://learnopencv.com/rotation-matrix-to-euler-angles/

If this doesn't help, then I might misunderstood your question.

Rasmus

Rassibassi avatar Feb 11 '23 09:02 Rassibassi

Also checkout the following link for more polished mediapipe demos: https://github.com/Rassibassi/mediapipeDemos

Rassibassi avatar Feb 11 '23 09:02 Rassibassi

Isn't the headposture example what you need? https://github.com/Rassibassi/mediapipeDemos/blob/main/head_posture.py

There you have a vector pointing in the direction of the face, including mediapipe and cv2 rotation vectors.

Rassibassi avatar Feb 11 '23 09:02 Rassibassi