title: OpenCV: How-to calculate distance between camera and object using image?
body: <p>I am a newbie in OpenCV. I am working with the following formula to calculate distance:</p>
  
  <pre><code>distance to object (mm) = focal length (mm) * real height of the object (mm) * image height (pixels)
                            ----------------------------------------------------------------
                                  object height (pixels) * sensor height (mm)
  </code></pre>
  
  <p>Is there a function in OpenCV that can determine object distance? If not, any reference to sample code?</p>