OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Sun, 16 Feb 2020 18:03:37 -0600Determining types of 3D transformation between two sets of cloud pointshttp://answers.opencv.org/question/226378/determining-types-of-3d-transformation-between-two-sets-of-cloud-points/ Hi. I am new in the forum and I have a little question.
I have two cloud of points in 3D and I know that the second cloud is obtained applying a transformation matrix.
I think, if I am not mistaken, that I need to use the [estimateAffine3D](https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=estimate#cv2.estimateAffine3D) function.
But, in this case, I would like to know how much of each transformation has been applied. For example, I would like to know if the second set of clouds has been scaled 2 times, rotated 25ยบ and sheared 5 units in the X axis.
The second set of points can have any kind of transformations.
thanks a lot for your time!
IbaiSun, 16 Feb 2020 18:03:37 -0600http://answers.opencv.org/question/226378/How can I get rotation-vector from Euler-angles?http://answers.opencv.org/question/88531/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](http://docs.opencv.org/2.4/modules/viz/doc/viz3d.html#)?
I.e. how can I get `Vec3d( X, Y, Z)` from [Euler-angles](https://en.wikipedia.org/wiki/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()](http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=euler#rqdecomp3x3) or as shown in [that question](http://answers.opencv.org/question/8842/rotation-matrix-to-euler-angle/), but whether is there an inverse function in the OpenCV to find rotation-matrix from Euler-angles or better to find rotation-vector( `Vec3d( X, Y, Z)` )?AlexBThu, 25 Feb 2016 03:05:56 -0600http://answers.opencv.org/question/88531/Decompose 3D affine matrixhttp://answers.opencv.org/question/66751/decompose-3d-affine-matrix/Is there any method in openCV to decompose the 3D affine transformation matrix? maystroh10Tue, 21 Jul 2015 11:50:34 -0500http://answers.opencv.org/question/66751/How to relocate face points in opencv / face distortionhttp://answers.opencv.org/question/8088/how-to-relocate-face-points-in-opencv-face-distortion/I have to simulate facial expressions on a face image ( say open mouth ). For this I first extracted the facial feature points and found the corners of the lips. Now I need to deform the image by moving the points down.
![enter image description here][1]
In the above image I need to move the points ( 2 ) and ( 3 ) to some distance left and right respectively. And point ( 18 ) and ( 19 ) littele bit down. So that I will get an expression like opened mouth.
**My Questions:**
1) Is this the above way right to proceed to simulate facial expression?
**2) If it is right how to move the points and create a new image in opencv?**
[1]: http://i.stack.imgur.com/ciyrm.jpgUserOpenCVTue, 26 Feb 2013 06:27:44 -0600http://answers.opencv.org/question/8088/estimateAffine3D resulthttp://answers.opencv.org/question/2306/estimateaffine3d-result/I am trying to measure the 3D relative position between two markers detected
with a cvTriangulatePoints() and a stereo rig.
I get reasonably accurate 3D positions for the markers.
I then try and find the rigid body transform between them:
Using my own SVD based solution I get a reasonable answer
[-0.9965, 0.0532, -0.06352, 458.125
0.0074, 0.8208, 0.5711, -442.424
-0.0825, -0.568, 0.8183, 109.835 ]
With estimateAffine3D() I get:
[0.90201, 0.1902, 0.202241, -108.809
0.03214, 0.3073, -0.62058, 458.116
0.06676, -2.065, -1.58894, 1722.368]
Not sure how to interpret the output of affine 3D, some of the values seem to
line up (give or take a sign change).
But how do you have a rotation matrix value of "-2" ?
I'm not even sure what an affine transform means in 3D!
mgbFri, 14 Sep 2012 10:16:02 -0500http://answers.opencv.org/question/2306/