Ask Your Question

Revision history [back]

How to calculate the angle relative to the camera - python

Hi, I'm using python to write a head pose estimation program. I saw all the demos and other projects online but I couldn't understand how to find the angles of the pitch, yaw and roll, relative to the camera. I used to project 3 axes on a frame using cv2.drawFrameAxes function (so I do have the vectors and camera calibration) but I need to get an angle (0 degrees, 15, 45, etc).

Thank you for your help and time, Anthon.

How to calculate the angle relative to the camera - python

Hi, I'm using python to write a head pose estimation program. I saw all the demos and other projects online but I couldn't understand how to find the angles of the pitch, yaw and roll, relative to the camera. I used to project 3 axes on a frame using cv2.drawFrameAxes function (so I do have the vectors and camera calibration) but I need to get an angle (0 degrees, 15, 45, etc).

Thank you for your help and time, Anthon.

Update: I've posted a solution but it seems that the solution doesn't appear. I'm linking a similar solution that takes the rotation vector from SolvePnP. https://answers.opencv.org/question/161369/retrieve-yaw-pitch-roll-from-rvec/?answer=162867 I haven't tested this solution.