title: OpenCV Camera Motion Estimation
body: <p>I am trying to implement an algorithm for estimating the camera motion following the instructions provided here:</p>
  
  <p><a href="http://www.morethantechnical.com/2012/02/07/structure-from-motion-and-3d-reconstruction-on-the-easy-in-opencv-2-3-w-code/" rel="nofollow">http://www.morethantechnical.com/2012/02/07/structure-from-motion-and-3d-reconstruction-on-the-easy-in-opencv-2-3-w-code/</a></p>
  
  <p>I solely aim to retrieve the camera motion and not to reconstruct the scene.</p>
  
  <p>So captured one image with, my camera then moved it slightly to the right (no rotation) and tried to check the consistency of my results.</p>
  
  <p>I make the assumption that the first camera matrix is canonical, so I calculate and decompose the essential matrix to extract the camera matrix of the second view. I calibrated my camera with the method proposed in the OpenCV online documentation and got a reprojection error of about 3 pixels (which I feel is slightly high).</p>
  
  <p>I get the following results: </p>
  
  <pre><code>R:
  [-0.9849526307494116, 0.01908251779036621, -0.1717677871272531;
   0.05845683495175302, -0.8985189871723962, -0.4350246293465628;
   -0.1626379833471766, -0.4385196542978104, 0.8838831366008135]
  
  t:
  [-0.08455893449383088; -0.224114799153024; 0.9708873999583411]
  </code></pre>
  
  <p><strong>R</strong> seems to be valid (determinant equal to 1, vectors forming an orthonormal basis) however I think that it is inconsistent since, as I already mentioned my camera, was not rotated between the two views. I assume that <strong>R</strong> should be close to the 3x3 unity matrix and the <strong>t</strong> vector should only describe a translation along the x-axis. </p>
  
  <p>Since I am a beginner on this particular computer vision subject, I would like to ask if this is something that could be attributed to errors in my code or I am wrong in assuming that the original camera frame (corresponding to the canonical camera matrix) has its x,y axes aligned with the x,y axes of the image and its z axis facing towards the scene.</p>
  
  <p>Thank you very much for your help !</p>