Camera pose from homography?

asked 2017-07-15 02:05:54 -0500

swiss_knight gravatar image

updated 2017-07-15 02:09:15 -0500

Given K, an intrinsic camera matrix, a reference image from a camera 1 which pose is known and an image from a camera 2 which pose is unknown, is there a way to compute the pose of camera 2 using the homography matrix found between the two images from matched key-points if I know their 3D coordinates (these points may not be coplanar at all)? Or, if not, from anyone of the fundamental or essential matrices?

Could it perform better or faster thant SolvePnP?

edit retag flag offensive close merge delete


Camera pose from homography is possible, see for instance here or here. In both methods, you need to know the 3D coordinates of the points in the object frame also (with the homography based method, it assumes Z=0).

Note also that with the homography based method, the homography relates the transformation between 2D points on the marker plane (Z=0) and their projections in the 2D image plane.

Eduardo gravatar imageEduardo ( 2017-07-17 04:49:52 -0500 )edit

So, basically, if I have some complex 3D object like a tree or scene like a landscape with no planes at all, it won't work?

swiss_knight gravatar imageswiss_knight ( 2017-07-18 07:22:50 -0500 )edit

No, the method I linked to compute the camera pose from the homography assumes a planar object: the homography transformation is between the plane object and the image plane (the object projected into the image plane).

Eduardo gravatar imageEduardo ( 2017-07-18 08:18:41 -0500 )edit

so what is the common way in case we do not have any information about the 3D points? I obtain ORB features between consecutive frames, match the features with already available methods in opencv. and use cv::findHomography() to calculate the homography. Then cv::decomposeHomographyMat() give results in 4 different solutions. I do not know what is the correct way is to get correct 4x4 transformation matrix in this approach.

Farid gravatar imageFarid ( 2019-06-26 06:59:32 -0500 )edit

What are you trying to achieve?

Camera pose estimation like solvePnP (rotation and translation to transform from object frame to camera frame) or camera displacement estimation (rotation and translation to transform from the previous camera frame to the current camera frame)?

Eduardo gravatar imageEduardo ( 2019-07-03 12:31:58 -0500 )edit