title: pose estimation: determine whether rotation and transmation matrix are right
body: <p>Recently I'm struggling with a <strong>pose estimation</strong> problem with a single camera. I have some 3D points and the corresponding 2D points on the image. Then I use solvePnP to get the rotation and translation vectors. <strong>The problem is</strong>, how can I determine whether the vectors are right results?</p>
  <p>Now I use an indirect way to do this:<br />
  I use the rotation matrix, the translation vector and the world 3D coordinates of a certain point to obtain the coordinates of that point in Camera system. Then all I have to do is to determine whether the coordinates are reasonable. I think I know the directions of x, y and z axes of Camera system.</p>
  <ul>
  <li>Is Camera center the origin of the Camera system?</li>
  <li>Now consider the x component of that point. Is x equavalent to the distance of the camera and the point in the world space in Camera's x-axis direction (the sign can then be determined by the point is placed on which side of the camera)?</li>
  </ul>
  <p>The figure below is in world space, while the axes depicted are in Camera system.</p>
  <pre><code>========How Camera and the point be placed in the world space=============
     |
     |              
  Camera--------------------------&gt; Z axis
     |                |} Xw?
     |                P(Xw, Yw, Zw)
     |              
     v x-axis     
       
  </code></pre>
  <p><a href="https://i.stack.imgur.com/FHDKq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FHDKq.jpg" alt="Picture here" /></a></p>
  <p>My rvec and tvec results seems right and wrong. For a specified point, the z value seems reasonable, I mean, if this point is about one meter away from the camera in the z direction, then the z value is about 1. But for x and y, according to the location of the point <strong>I think x and y should be positive but they are negative</strong>. What's more, the pattern detected in the original image is like this:</p>
  <p><a href="https://i.stack.imgur.com/ezmTE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ezmTE.png" alt="pattern image using feature detection from the camera captured image" /></a></p>
  <p>But using the points coordinates calculated in Camera system and the camera intrinsic parameters, I get an image like this:</p>
  <p><a href="https://i.stack.imgur.com/VBXaI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VBXaI.png" alt="recovered image" /></a></p>
  <p>The target keeps its pattern. But it moved from bottom right to top left. I cannot understand why.</p>