title: Convert from pixel to cm with camera matrix and distance, opencv function
body: <p>Is there any opencv function to convert pixel to cm?</p>
  <p>I have a bounding box in pixel and want to know the size of my object in cm.
  I have already done a camera calibration to get my camera-matrix with the focal <em>f</em><sub>x</sub> and <em>f</em><sub>y</sub>.</p>
  <p>So normally the formula for my vector of one point is:</p>
  <p><em>p</em><sub>x</sub>[cm]= <em>z</em>/<em>f</em><sub>x</sub> (<em>u</em> - <em>c</em><sub>x</sub>) and <em>p</em><sub>y</sub>[cm]= <em>z</em>/<em>f</em><sub>y</sub> (<em>v</em> - <em>c</em><sub>y</sub>)</p>
  <p>where <em>z</em> is the distance in cm from camera to object, <em>f</em> the focal length, <em>u</em> and <em>v</em> is the point in pixel and <em>c</em> is the camera main point (middle point of the picture).</p>
  <p>I get the distance to my object from a sensor.</p>
  <p>Of course I can do this for all my box points and do some trigonometry to find the length and hight of my object in cm.</p>
  <p>But I was wondering if there is already some opencv or other function for this. Unfortunately I didn't find anything.</p>