Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I get rotation-vector from Euler-angles?

If I have 3 Euler-angles then how can I get rotation-vector to use it for camera-rotation in OpenCV-viz3d?

I.e. how can I get Vec3d( X, Y, Z) from Euler-angles (alfa, betta, gamma) to use in this code?

viz::Viz3d viz_3d_window("Viz window");
cv::Affine3d pose = viz_3d_window.getViewerPose();
viz_3d_window.setViewerPose( pose.rotate( Vec3d( X, Y, Z) ) );

cv::Affine3d::rotate(); https://github.com/Itseez/opencv/blob/f9e2b036a502309c0da5abc5e711d4cd64eb8a38/modules/core/include/opencv2/core/affine.hpp#L114

I can find Euler-angles from rotation-matrix by using RQDecomp3x3() or as shown in that question, but whether there is an inverse function in the OpenCV to find rotation-matrix from Euler-angles or better to find rotation-vector( Vec3d( X, Y, Z) )?

How can I get rotation-vector from Euler-angles?

If I have 3 Euler-angles then how can I get rotation-vector to use it for camera-rotation in OpenCV-viz3d?

I.e. how can I get Vec3d( X, Y, Z) from Euler-angles (alfa, betta, gamma) to use in this code?

viz::Viz3d viz_3d_window("Viz window");
cv::Affine3d pose = viz_3d_window.getViewerPose();
viz_3d_window.setViewerPose( pose.rotate( Vec3d( X, Y, Z) ) );

cv::Affine3d::rotate(); https://github.com/Itseez/opencv/blob/f9e2b036a502309c0da5abc5e711d4cd64eb8a38/modules/core/include/opencv2/core/affine.hpp#L114

I can find Euler-angles from rotation-matrix by using RQDecomp3x3() or as shown in that question, but whether is there is an inverse function in the OpenCV to find rotation-matrix from Euler-angles or better to find rotation-vector( Vec3d( X, Y, Z) )?