0

I want to calculate the distance between object and camera in real time. In my research i have found some formula's

d = h * tan a

from here

and

distance to object (mm) = focal length (mm) * real height of the object (mm) * image height (pixels)
                      ----------------------------------------------------------------
                            object height (pixels) * sensor height (mm)

from here. And python code from

But both of these required the constant value of Object Height.

Is there any possible to get without Object Height or any libraries available for iOS.

Jegan
  • 597
  • 3
  • 18
  • have you tried asking https://math.stackexchange.com/ – Amr Oct 11 '17 at 07:35
  • There is no other way. You have two options either you know the size of the object and then by ration to what you have measured you calculate the distance or (and this one is in your case only hypothetical) you fire a beam and from its speed and the time of the response you calculate the distance. – Croolman Oct 11 '17 at 08:14
  • If the object is static you can use some structure from motion algorithms, but you would need to move the camera and track the object – Ben Oct 13 '17 at 15:15
  • Did you find any solution? I'm stuck in same scenario. – Divya Thakkar May 02 '18 at 05:15
  • 0 I want to calculate the distance between object and camera in real time. In my research i have found some formula's d = h * tan a from here and distance to object (mm) = focal length (mm) * real height of the object (mm) * image height (pixels) ---------------------------------------------------------------- object height (pixels) * sensor height (mm) from here. And python code from But both of these required the constant value of Object Height. – Selvamani P Jan 30 '19 at 11:26

0 Answers0