# SolvePnp: similar input returns very different output

Hello,

I am using a planar object (composed of 16 3D points, all with Z=0). When I use SolvePnp with 16 2D points, I usually get results that make sense. However, if I move my planar object, for example translating it along the Y axis (up-down), at a certain configuration the output changes abruptly. If I keep moving in the same direction, the reconstructed 3D pose keeps changing smoothly from the new values.

I plotted the 3D position of my 16 points, and I notice that when the abrupt change happens, the reconstruction is still plausible, except that it is rotated by about 30 degrees along some axis in the middle of the object.

This is highly repeatable, and always happens at about the same point (i.e. the same Y axis location).

Any thoughts why this happens and how it can be avoided?

Thanks!

edit retag close merge delete

Sort by ยป oldest newest most voted

Is the jump really related to y-location? I believe it is caused by the pose of the object, which also changes as you move the object up. Can you fix the object location and change only its pose?

The solution of solvePnP is not constrained sufficiently in that particular pose which may cause instability. You can consider some temporal smoothing to reduce this effect.

more

I repeated the test by translating the camera (very accurate) while keeping the object stationary. I see the same results.

I am thinking that it's maybe related to the configuration of the points used. Imagine that I have 4 points on a plane as follows: A(0,0,0) ====== B(10,0,0) || \ C(0,10,0)=============D(15,10,0)

I can see how a rotation of the object about a line parallel to AB and CD and in between them would still make all the points project to the same 2D positions. So this can create an ambiguity.... right? And if you agree, what would be a good set of points to use?

( 2013-04-18 16:06:17 -0600 )edit

I had similar problem when testing detection/pose recognition of AR markers from AR Toolkit. In that case, when the marker is viewed from top (without any perspective distortion) the solution to the pose estimation was unstable. In contrast when the marker was viewed from angle, the estimation was accurate. This is caused by the fact that the points are on plain and the estimation is done in 3D. When the plane is facing you, it will have the same projection to 2D plain as if facing other way round. Note, the estimation was done from 4 points only. Hope this helps.

( 2013-04-20 13:56:17 -0600 )edit

Official site

GitHub

Wiki

Documentation