# how to get angles of x y z in pose estimation?

i use landmark to extract face points and use solvePnP to estimate head pose but now i don't know how calculate head angles from X, Y and Z axis with solvePnP output parameters ? i try to convert rvet values to degree but seem some times values bigger than 180 !!!

edit retag close merge delete

Sort by » oldest newest most voted You want to obtain yaw, pitch and roll from 3x1 rotation Vector, if i understand you correctly.

You should first use function "Rodrigues" to create a 3x3 rotation matrix out of it. Write something like:

cv::Mat rotMat(3,3, CV_64FC1);
cv::Rodrigues(rotVec.at(0), rotMat); //convert 3x1 to 3x3


Next i suggest you have a look at this. Its more or less what you require!

more

but whats mean 2(r21,r11) ? mean of ',' its product or other mean ?

"Each quadrant should be chosen by using the signs of the numerator and denominator of the argument. The numerator sign selects whether the direction will be above or below the x-axis, and the denominator selects whether the direction will be to the left or right of the y-axis. This is the same as the atan2 function in the C programming language, which nicely expands the range of the arctangent to [0,2pi]"

The part where it states "This is the same as the 2" ... for some reason its cut off ... its atan2.

Please also be aware of the last sentence ... "Note that this method assumes r11 != 0 + r33 != 0."

atan2 function requires two arguments ; y and x. The comma is only the separator between the two arguments.

Official site

GitHub

Wiki

Documentation