PnP - rotation vector interpretation

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I work on the Perspective-n-Point problem. From 4 img points in img CS (2D) and 4 corresponding points in world CS (3D, XYZ), I want to get the rotation and translation of the camera.
In fact, opencv function cv2.solvePnP() solves that problem for me. It returns rotation as rotation vector [3x1] and translation vector.



I would like to ask for help with interpreting the rotation vector.



As far as I understand the rotation vector representation:



  • the rotation vector is the axis of the rotation

  • the length of rotation vector is the rotation angle θ in radians
    [around axis, which is rotation vector]

Lets' say the function returns rotation vector rvec as below:
$$rvec = [-1.5147142; 0.11365167; 0.10590861]]$$



Then:



$$theta_rvec = sqrt(-1.5147142^2 + 0.11365167^2 + 0.10590861^2) [rad] = 1.52266 [rad] = frac1.52266*1803.14 [deg] = 87.286 [deg]$$



1. Does three rvec components (-1.5147142; 0.11365167; 0.10590861) correspond to world coordinates?
2. Can I interpret the vector components as separate rotation angles in radians around components directions?



My rvec components interpretation:



$$alpha_X = -1.5147142 [rad] = frac-1.5147*1803.14 [deg] = -86.83 [deg]$$



$$beta_Y = 0.11365167 [rad] = frac0.11365167*1803.14 [deg] = 6.52 [deg]$$



$$gamma_Z = 0.10590861 [rad] = frac0.10590861*1803.14 [deg] = 6.07 [deg]$$



$alpha_X$ - angle around X (direction of first component)



$beta_X$ - angle around Y (direction of second component)



$gamma_X$- angle around Z (direction of third component)



My usecase: I have coordinates of four image points. I know the coordinates of these points in the real world. I know camera intrinsic matrix. I use PnP3 to get rotation and translation vector. From rotation matrix, I would like to find out what are the angles around fixed global/world axes: X, Y, Z. I am NOT interested in Euler angles. I want to find out how an object is being rotated around the fixed world coordinates (not it's own coordinate system).



I would really appreciate your help. I feel lost in rotation. Thank you in advance.







share|cite|improve this question




















  • You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
    – amd
    Aug 26 at 16:25














up vote
0
down vote

favorite












I work on the Perspective-n-Point problem. From 4 img points in img CS (2D) and 4 corresponding points in world CS (3D, XYZ), I want to get the rotation and translation of the camera.
In fact, opencv function cv2.solvePnP() solves that problem for me. It returns rotation as rotation vector [3x1] and translation vector.



I would like to ask for help with interpreting the rotation vector.



As far as I understand the rotation vector representation:



  • the rotation vector is the axis of the rotation

  • the length of rotation vector is the rotation angle θ in radians
    [around axis, which is rotation vector]

Lets' say the function returns rotation vector rvec as below:
$$rvec = [-1.5147142; 0.11365167; 0.10590861]]$$



Then:



$$theta_rvec = sqrt(-1.5147142^2 + 0.11365167^2 + 0.10590861^2) [rad] = 1.52266 [rad] = frac1.52266*1803.14 [deg] = 87.286 [deg]$$



1. Does three rvec components (-1.5147142; 0.11365167; 0.10590861) correspond to world coordinates?
2. Can I interpret the vector components as separate rotation angles in radians around components directions?



My rvec components interpretation:



$$alpha_X = -1.5147142 [rad] = frac-1.5147*1803.14 [deg] = -86.83 [deg]$$



$$beta_Y = 0.11365167 [rad] = frac0.11365167*1803.14 [deg] = 6.52 [deg]$$



$$gamma_Z = 0.10590861 [rad] = frac0.10590861*1803.14 [deg] = 6.07 [deg]$$



$alpha_X$ - angle around X (direction of first component)



$beta_X$ - angle around Y (direction of second component)



$gamma_X$- angle around Z (direction of third component)



My usecase: I have coordinates of four image points. I know the coordinates of these points in the real world. I know camera intrinsic matrix. I use PnP3 to get rotation and translation vector. From rotation matrix, I would like to find out what are the angles around fixed global/world axes: X, Y, Z. I am NOT interested in Euler angles. I want to find out how an object is being rotated around the fixed world coordinates (not it's own coordinate system).



I would really appreciate your help. I feel lost in rotation. Thank you in advance.







share|cite|improve this question




















  • You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
    – amd
    Aug 26 at 16:25












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I work on the Perspective-n-Point problem. From 4 img points in img CS (2D) and 4 corresponding points in world CS (3D, XYZ), I want to get the rotation and translation of the camera.
In fact, opencv function cv2.solvePnP() solves that problem for me. It returns rotation as rotation vector [3x1] and translation vector.



I would like to ask for help with interpreting the rotation vector.



As far as I understand the rotation vector representation:



  • the rotation vector is the axis of the rotation

  • the length of rotation vector is the rotation angle θ in radians
    [around axis, which is rotation vector]

Lets' say the function returns rotation vector rvec as below:
$$rvec = [-1.5147142; 0.11365167; 0.10590861]]$$



Then:



$$theta_rvec = sqrt(-1.5147142^2 + 0.11365167^2 + 0.10590861^2) [rad] = 1.52266 [rad] = frac1.52266*1803.14 [deg] = 87.286 [deg]$$



1. Does three rvec components (-1.5147142; 0.11365167; 0.10590861) correspond to world coordinates?
2. Can I interpret the vector components as separate rotation angles in radians around components directions?



My rvec components interpretation:



$$alpha_X = -1.5147142 [rad] = frac-1.5147*1803.14 [deg] = -86.83 [deg]$$



$$beta_Y = 0.11365167 [rad] = frac0.11365167*1803.14 [deg] = 6.52 [deg]$$



$$gamma_Z = 0.10590861 [rad] = frac0.10590861*1803.14 [deg] = 6.07 [deg]$$



$alpha_X$ - angle around X (direction of first component)



$beta_X$ - angle around Y (direction of second component)



$gamma_X$- angle around Z (direction of third component)



My usecase: I have coordinates of four image points. I know the coordinates of these points in the real world. I know camera intrinsic matrix. I use PnP3 to get rotation and translation vector. From rotation matrix, I would like to find out what are the angles around fixed global/world axes: X, Y, Z. I am NOT interested in Euler angles. I want to find out how an object is being rotated around the fixed world coordinates (not it's own coordinate system).



I would really appreciate your help. I feel lost in rotation. Thank you in advance.







share|cite|improve this question












I work on the Perspective-n-Point problem. From 4 img points in img CS (2D) and 4 corresponding points in world CS (3D, XYZ), I want to get the rotation and translation of the camera.
In fact, opencv function cv2.solvePnP() solves that problem for me. It returns rotation as rotation vector [3x1] and translation vector.



I would like to ask for help with interpreting the rotation vector.



As far as I understand the rotation vector representation:



  • the rotation vector is the axis of the rotation

  • the length of rotation vector is the rotation angle θ in radians
    [around axis, which is rotation vector]

Lets' say the function returns rotation vector rvec as below:
$$rvec = [-1.5147142; 0.11365167; 0.10590861]]$$



Then:



$$theta_rvec = sqrt(-1.5147142^2 + 0.11365167^2 + 0.10590861^2) [rad] = 1.52266 [rad] = frac1.52266*1803.14 [deg] = 87.286 [deg]$$



1. Does three rvec components (-1.5147142; 0.11365167; 0.10590861) correspond to world coordinates?
2. Can I interpret the vector components as separate rotation angles in radians around components directions?



My rvec components interpretation:



$$alpha_X = -1.5147142 [rad] = frac-1.5147*1803.14 [deg] = -86.83 [deg]$$



$$beta_Y = 0.11365167 [rad] = frac0.11365167*1803.14 [deg] = 6.52 [deg]$$



$$gamma_Z = 0.10590861 [rad] = frac0.10590861*1803.14 [deg] = 6.07 [deg]$$



$alpha_X$ - angle around X (direction of first component)



$beta_X$ - angle around Y (direction of second component)



$gamma_X$- angle around Z (direction of third component)



My usecase: I have coordinates of four image points. I know the coordinates of these points in the real world. I know camera intrinsic matrix. I use PnP3 to get rotation and translation vector. From rotation matrix, I would like to find out what are the angles around fixed global/world axes: X, Y, Z. I am NOT interested in Euler angles. I want to find out how an object is being rotated around the fixed world coordinates (not it's own coordinate system).



I would really appreciate your help. I feel lost in rotation. Thank you in advance.









share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Aug 26 at 12:21









Kingkin

1




1











  • You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
    – amd
    Aug 26 at 16:25
















  • You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
    – amd
    Aug 26 at 16:25















You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
– amd
Aug 26 at 16:25




You could start by reading the documentation for cv2.solvePnP, which, if you follow the links in it, explains how to interpret the rotation vector.
– amd
Aug 26 at 16:25















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2894985%2fpnp-rotation-vector-interpretation%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2894985%2fpnp-rotation-vector-interpretation%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?