title: Want to find the Focal length first then distance of face detected in real time using opencv android
body: <p>Formula for focal length is given below:</p>
  
  <p>F = (P x D) / W</p>
  
  <p>But I am unable to find pixel value (P) of the rectangle that appears on the detected face in real time:</p>
  
  <p>Want to find the width of rectangle drawn around the mobile phone in the image:</p>
  
  <p><a href="https://i.stack.imgur.com/sstQF.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/sstQF.jpg" alt="enter image description here"></a></p>
  
  <p>It was done using Python and OpenCV but I am confused as to how to implement it in Java OpenCV.</p>
  
  <p><a href="http://www.pyimagesearch.com/2015/01/19/find-distance-camera-objectmarker-using-python-opencv/" rel="noreferrer">http://www.pyimagesearch.com/2015/01/19/find-distance-camera-objectmarker-using-python-opencv/</a></p>