SolvePnP vs Calibrate camera

asked 2018-12-12 09:05:36 -0500

user8469759 gravatar image

I have a very quick question, in case I'll try to generate a simple example. I'm writing some alignment code, given instrinsics and distortion parameters.

The idea is to pre-estimate intrinsics and later, given a couple of images from different poses estimate the extrinsics.

For this job I'm running the opencv examples on the subject. For the camera calibration the meat of the code is calibrate_camera, such function according to the doc will estimate everything including extrinsics per pose.

It is raccomended however to use solvePnP to retrieve the extrinsics if the intrinsics are already given. It is also mentioned in the doc that calibrate_camera also calls solvePnP at some point.

However when I run solvePnP for an image pair that I have also used to find intrinsics I get different results for the extrinsics.

To summarize, to find the intrinsics and distortion of the camera I'm using the code provided by this example, given these intrinsics and distortion I'm trying to estimate the extrinsics using the a solvePnP call (I need to call it two times, one per pose and with some linear algebra I can get the relative pose).

However as I said I'm getting different results, and I can't figure why (quite different results). What I'm getting though is valid, since I can construct a valid essential matrix (I've tested this using the single value decomposition).

edit retag flag offensive close merge delete