I am attempting to estimate absolute camera position for uncalibrated image, i.e. on a single image. I have 2 sets of key points: on 3d model (object coordinates) and 2d image (uv cooordinates). Let's assume the key points are accurate. Then I perform the following steps:
- I apply standard Direct Linear Transformation (DLT) to estimate the projection matrix P - from 3d "world" to 2d image transformation x = P*X;
- OpenCV DecomposeProjectionMatrix() function helps to decompose the projection matrix into extrinsic and intrinsic matrices: P = K {R|t};
- To improve my first guess on rotation and translation matrices, I apply SolvePnP (with Iterative method, as I understood it provides me "the best" solution) function to the key points sets and camera parameters;
While running my combined algorithm on several cases, I noticed that in majority cases SolvePnP returns very close results to the ground truth. The rests results are inaccurate and rotation and translation are far away from the reality.
Q: Is it possible to make improvement for these cases where my current algorithm fails: May be optimize intrinsic parameters based on OpenCV CameraCalibrate(), or apply other SolvePnP algorithms?