title: how to get Distance of Object from iPhone camera using image Exif meta data?
body: <hr>
  
  <p><strong>Edit</strong>: Sorry for late Edit, Without two parameter you cannot calculate it, 
   So first need to fill user Camera height from ground.</p>
  
  <hr>
  
  <p>I have check a number of solutions but none of them helpful!</p>
  
  <p><strong>I know that Working Distance = (Sensor Height + Subject Height) * Focal Length / Sensor Height</strong></p>
  
  <p>and</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>And I want to get distance from this:</p>
  
  <p><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/class/phscilab/imagei.html" rel="noreferrer">Image Formation by Lenses and the Eye</a></p>
  
  <p>Hello I get the following info using image Exif  <a href="https://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html" rel="noreferrer">ALAssetsLibrary</a></p>
  
  <p>And I got following meta data :</p>
  
  <pre><code>Save image metadata.
   {
      DPIHeight = 72;
      DPIWidth = 72;
      FaceRegions =     {
          Regions =         {
              HeightAppliedTo = 2448;
              RegionList =             (
                                  {
                      AngleInfoRoll = 270;
                      AngleInfoYaw = 0;
                      ConfidenceLevel = 376;
                      FaceID = 1;
                      Height = "0.1413399";
                      Timestamp = 5996166864910;
                      Type = Face;
                      Width = "0.1060049";
                      X = "0.3560049";
                      Y = "0.4746732";
                  }
              );
              WidthAppliedTo = 3264;
          };
      };
      Orientation = 6;
      "{Exif}" =     {
          ApertureValue = "2.526068811667587";
          BrightnessValue = "1.291629806962232";
          ColorSpace = 1;
          DateTimeDigitized = "2014:03:25 15:43:36";
          DateTimeOriginal = "2014:03:25 15:43:36";
          ExposureMode = 0;
          ExposureProgram = 2;
          ExposureTime = "0.05";
          FNumber = "2.4";
          Flash = 24;
          FocalLenIn35mmFilm = 33;
          FocalLength = "4.12";
          ISOSpeedRatings =         (
              160
          );
          LensMake = Apple;
          LensModel = "iPhone 5 back camera 4.12mm f/2.4";
          LensSpecification =         (
              "4.12",
              "4.12",
              "2.4",
              "2.4"
          );
          MeteringMode = 5;
          PixelXDimension = 3264;
          PixelYDimension = 2448;
          SceneType = 1;
          SensingMethod = 2;
          ShutterSpeedValue = "4.321956949076723";
          SubjectArea =         (
              1631,
              1223,
              1795,
              1077
          );
          SubsecTimeDigitized = 261;
          SubsecTimeOriginal = 261;
          UserComment = hoge;
          WhiteBalance = 0;
      };
      "{GPS}" =     {
          Altitude = "196.008";
          AltitudeRef = 0;
          DateStamp = "2014:03:25";
          Latitude = "28.61772";
          LatitudeRef = N;
          Longitude = "77.38891";
          LongitudeRef = E;
          TimeStamp = "10:13:37.439000";
      };
      "{MakerApple}" =     {
          1 = 0;
          3 =         {
              epoch = 0;
              flags = 1;
              timescale = 1000000000;
              value = 249840592070541;
          };
          4 = 0;
          5 = 179;
          6 = 139;
          7 = 1;
      };
      "{TIFF}" =     {
          DateTime = "2014:03:25 15:43:36";
          Make = Apple;
          Model = "iPhone 5";
          Software = "7.0.6";
          XResolution = 72;
          YResolution = 72;
      };
  }
  </code></pre>
  
  <p>I need to calculate the distance of the object from the camera, using the above details; using iphone4s,iphone5, or iphone5s.
  Is it possible?</p>
  
  <p><img src="https://i.stack.imgur.com/hVgOq.jpg" alt="enter image description here"></p>
  
  <p><strong>Modified Need to know formula used by this app any idea:</strong></p>
  
  <p>Need to know any method </p>
  
  <p><a href="http://www.youtube.com/watch?v=eCStIagorx8" rel="noreferrer">http://www.youtube.com/watch?v=eCStIagorx8</a> </p>
  
  <p>how this App working ???
  All Help are welcome</p>