title: How to get the camera rotation? (Aruco Library)
body: <p>I've been trying to understand the output of the aruco_test.cpp program that is included when you download the Aruco Library.</p>
  
  <p>The output has this format:</p>
  
  <pre><code>22=(236.87,86.4296) (422.581,78.3856) (418.21,228.032) (261.347,228.529) Txyz=0.00813142 -0.0148134 0.140595 Rxyz=-2.14032 0.0777095 0.138929
  </code></pre>
  
  <p>22 is the unique identifier of the marker, the next four pairs of numbers are the four corners of the marker. My problem here is the two vectors Tvec and Rvec.</p>
  
  <p>I've been reading on the Internet that tvec is the translation vector from my camera's center to my object (the marker in this case) and that rvec is the rotation of the object with respect to my camera.</p>
  
  <p>I've got a few questions regarding this:</p>
  
  <p>How can I know the axis of my camera? I mean, is there a way to know where the x, y and z are facing?</p>
  
  <p>How can I get the rotation of the camera from the rotation of the object wrt the camera?</p>
  
  <p>Can someone explain me the meaning of the vectors better so I can really understand it? I think my main problem here is that I don't really know what those numbers mean for real.</p>
  
  <p>EDIT: I've been doing some testing to check how the rotation works and I don't really understand the results:</p>
  
  <ol>
  <li>Moving the camera, marker fixed on the floor: </li>
  </ol>
  
  <p>Initial position: camera looking at the marker - 'z' axis of the marker looking to the camera, 'y' is going upwards and 'x' goes to the right: Rxyz=2.40804 -0.0823451 0.23141</p>
  
  <p>Moving the camera on the 'x' axis of the marker (tilt the camera up): Rxyz=-1.97658 -0.0506794 -0.020052</p>
  
  <p>Moving the camera on the 'y' axis of the marker (incline the camera to the right): Rxyz=2.74544 -0.118551 -0.973627</p>
  
  <p>Turn the camera 90 degrees (to the right): Rxyz=1.80194 -1.86528 0.746029</p>
  
  <ol start="2">
  <li>Moving the marker instead of the camera, leaving the camera fixed looking to the marker:</li>
  </ol>
  
  <p>Using the same initial position as in the previous case.</p>
  
  <p>Moving the marker on its 'x' axis: Rxyz=2.23619 -0.0361307 -0.0843008</p>
  
  <p>Moving the marker on its 'y' axis: Rxyz=-2.9065 -0.0291299 -1.13356</p>
  
  <p>Moving the marker on its 'z' axis (90º turn to the right): Rxyz=1.78398 1.74161 -0.690203</p>
  
  <p>I've been assuming that each number of the vector was the rotation on a respective axis but I think I'm assuming wrong as this values don't make so much sense if that was the case.</p>