SolvePnP returns wrong rotation

asked 2013-09-04 00:24:53 -0600

When I am use SolvePnP with the following input,

Object Points: [-0.61676002, 1.028221, -0.77537602; 0.59873599, 1.028221, -0.77537602; 0.59873599, -0.51325601, -0.77537602; -0.61676002, -0.51325601, -0.77537602]

Image Points: (402,248) (488,249) (488,334) (401,331)

Camera Matrix: [668.4575130373468, 0, 313.6345885516662; 0, 672.4221028415929, 297.1289305341491; 0, 0, 1]

Distortion Matrix: [-0.2075669187898052; 0.02304333936690098; 0.0115320494664536; 0.01892612902092278]

I get the following output,

Rotation Matrix: [2.477803830041645; 0.1019666558830727; -0.2187435040958511] Translation Matrix: [1.754309113253378; -0.3997550904964654; 8.871543174172041]

But with everything remaining the same and only image coordinates changed to the following,

Image Points: (400,250) (487,248) (489,334) (403,334)

I get output,

Rotation Matrix: [-2.469660868547366; 0.1061311873233061; 0.250678516093462] Translation Matrix: [1.803394908932455; 0.6221160882392592; 9.176883297578677]

Note that image coordinates have not changed much, but there is a huge change in the rotation vector output, why?

Rotation Matrix: [2.477803830041645; 0.1019666558830727; -0.2187435040958511]

versus

Rotation Matrix: [-2.469660868547366; 0.1061311873233061; 0.250678516093462]

I see some sign changes, is it a bug? I am using OpenCV4Android. Please help.

edit retag flag offensive close merge delete