Ask Your Question

3D reconstruction (SfM) - confusion with camera's extrinsic parameter

asked 2016-12-16 05:33:19 -0500

Hilman gravatar image

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

Reconstructed scene

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).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-12-16 15:14:46 -0500

Tetragramm gravatar image

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.

edit flag offensive delete link more



Other 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.

Tetragramm gravatar imageTetragramm ( 2016-12-16 23:53:54 -0500 )edit

Question Tools

1 follower


Asked: 2016-12-16 05:33:19 -0500

Seen: 416 times

Last updated: Dec 16 '16