androidiphoneandroid-sensorsdepth-testing2d-3d-conversion

How to measure distance between mobile phone and the object being photographed?


I am trying to obtain the distance between mobile and object for an application where I want to convert a 2D photograph to 3D object, I have the following doubts:

  1. Is there a way to get the distance between the lens of the mobile phone and the object that is being photographed?
  2. We can determine the focal length of the lens present inside the mobile in a similar way do we have depth sensor present inside the mobile-phone?
  3. Is the depth sensor present in all mobile-phones?

Stuff like direction and orientation of mobile-phone can be obtained using sensors present inside the phone. If there's no depth sensor present, how to measure distance using a phone itself?


Solution

  • here's something that I found useful. Not sure about android devices but ios can do it with truedepth https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/streaming_depth_data_from_the_truedepth_camera