Rassibassi / mediapipeFacegeometryPython

47 stars 14 forks source link

Rotation convention #3

Open DikshaMeghwal opened 1 year ago

DikshaMeghwal commented 1 year ago

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?

Rassibassi commented 1 year ago

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 commented 1 year ago

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

Rassibassi commented 1 year ago

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.