title: Depth map values in opencv's reprojectImageTo3D()
body: <p>OpenCV's reprojectImageTo3D() outputs a <em>"3-channel image representing a 3D surface"</em>.
  You can access this data by</p>
  
  <pre><code>Vec3f coordinates = _3dImage.at&lt;Vec3f&gt;(y,x);
  float depth = _3dImage.at&lt;Vec3f&gt;(y,x)[2];
  </code></pre>
  
  <p>witch returns a vector [X,Y,Z].</p>
  
  <p>In <em>"Learning OpenCV"</em> by Gary Bradski &amp; Adrian Kaehler, it is explained that the depth is calculated by</p>
  
  <p>Z = f T / (x_left - x_right)</p>
  
  <p>where f = focal length, T = eye base/translation between cameras, (x_left - x_right) = disparity</p>
  
  <p>This exact formula is implemented in OpenCV (I checked the source code - however there is for some reason an additional negative sign). The question is: <strong>In which unit are the X, Y, Z values specified?</strong></p>
  
  <p>T is in your unit (e.g. mm), x_l - x_r is in pixel and <strong>[ f ] = ?</strong></p>
  
  <p>When you calibrate the camera, you specify the chessboard's size in real world units (e.g. mm). Does the intrinsic matrix therefore have real world units? Or is it specified in px? Unfortunately I cannot find the answer in the documentation.</p>