Ask Your Question

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

asked 2017-06-14 00:45:20 -0500

aligoglos gravatar image

updated 2017-06-14 12:15:51 -0500

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-14 03:40:16 -0500

Ice_T02 gravatar image

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(, rotMat); //convert 3x1 to 3x3

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

edit flag offensive delete link more


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

aligoglos gravatar imagealigoglos ( 2017-06-14 12:14:41 -0500 )edit

"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."

Ice_T02 gravatar imageIce_T02 ( 2017-06-16 03:09:29 -0500 )edit

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

swiss_knight gravatar imageswiss_knight ( 2017-06-29 13:50:35 -0500 )edit

Question Tools



Asked: 2017-06-14 00:45:20 -0500

Seen: 899 times

Last updated: Jun 14 '17