First time here? Check out the FAQ!

Ask Your Question
0

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

asked Jun 14 '17

aligoglos gravatar image

updated Jun 14 '17

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 !!!

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Jun 14 '17

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

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

Preview: (hide)

Comments

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

aligoglos gravatar imagealigoglos (Jun 14 '17)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 (Jun 16 '17)edit

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

swiss_knight gravatar imageswiss_knight (Jun 29 '17)edit

Question Tools

2 followers

Stats

Asked: Jun 14 '17

Seen: 1,488 times

Last updated: Jun 14 '17