OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 16 Dec 2016 23:53:54 -06003D reconstruction (SfM) - confusion with camera's extrinsic parameterhttp://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/From two images (with known camera intrinsic parameter), I follow the usual pipeline to reconstruct its 3D points. In particular, I use the `cv2.findEssentialMat` and `cv2.recoverPose` function. From the `cv2.recoverPose`, I got the rotation and translation of the second camera (the first camera will has identity matrix for its rotation and zero vector for its translation). What confuse me is the value of the camera 2's translation that is `[ -0.98681175 0.08603786 0.1371133 ]`, where I got a negative x value. Clearly from my images, the second camera should move right, indicating a positive x value. Why is this? Is it because the matrix should show the movement of the points and not the camera itself (I always thought the extrinsic parameter shows the movement of the camera)?
Below are the two images (with highlighted keypoints used for 3D reconstruction) and the reconstructed scene.
![image description](/upfiles/148188731320673.jpg)
![Reconstructed scene](/upfiles/1481886957445836.png)
The two blue X marks above are camera 1 and camera 2 position (here, I have multiplied camera 2's translation with -1 to get a positive x value).Fri, 16 Dec 2016 05:33:19 -0600http://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/Answer by Tetragramm for <p>From two images (with known camera intrinsic parameter), I follow the usual pipeline to reconstruct its 3D points. In particular, I use the <code>cv2.findEssentialMat</code> and <code>cv2.recoverPose</code> function. From the <code>cv2.recoverPose</code>, I got the rotation and translation of the second camera (the first camera will has identity matrix for its rotation and zero vector for its translation). What confuse me is the value of the camera 2's translation that is <code>[ -0.98681175 0.08603786 0.1371133 ]</code>, where I got a negative x value. Clearly from my images, the second camera should move right, indicating a positive x value. Why is this? Is it because the matrix should show the movement of the points and not the camera itself (I always thought the extrinsic parameter shows the movement of the camera)?</p>
<p>Below are the two images (with highlighted keypoints used for 3D reconstruction) and the reconstructed scene.</p>
<p><img alt="image description" src="/upfiles/148188731320673.jpg"/></p>
<p><img alt="Reconstructed scene" src="/upfiles/1481886957445836.png"/></p>
<p>The two blue X marks above are camera 1 and camera 2 position (here, I have multiplied camera 2's translation with -1 to get a positive x value).</p>
http://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/?answer=119476#post-id-119476The rotation and translation you get are from the camera, to the world. So your first camera is (0,0,0), which is the same as it being the center of the world. The second camera is located at some positive x value from it. But the translation from camera2 to the world is the other way. So you have a -x translation in camera2's translation matrix.Fri, 16 Dec 2016 15:14:46 -0600http://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/?answer=119476#post-id-119476Comment by Tetragramm for <p>The rotation and translation you get are from the camera, to the world. So your first camera is (0,0,0), which is the same as it being the center of the world. The second camera is located at some positive x value from it. But the translation from camera2 to the world is the other way. So you have a -x translation in camera2's translation matrix.</p>
http://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/?comment=119500#post-id-119500Other libraries may have other ways. Some use differently oriented coordinate systems, others store the transformation from world->camera instead of camera->world, ect. It's up to you to make sure you're using the right information in the right places.Fri, 16 Dec 2016 23:53:54 -0600http://answers.opencv.org/question/119359/3d-reconstruction-sfm-confusion-with-cameras-extrinsic-parameter/?comment=119500#post-id-119500