Calculate the distance between the iPhone and a door, knowing their physical widths

那年仲夏 提交于 2019-12-11 02:27:23

问题


I have this scenario:

I know the physical (not only in pixel) size of the screen of the iPhone.

Also I know the width of a door.

Now, if I have the iPhone camera on (with UIImagePicker or whatever), and I am in the position where the width of the door fits perfectly in the width of the camera, and the iPhone stands perfectly vertical, is it possible to know the distance between the iPhone and the door?


回答1:


It would depend on the camera specs which vary between devices. For this reason I would try to sample some data with a ruler - for instance take a 3' wide plank, align the edges perfectly and measure distance. Do this with varying widths on different devices and you'll have a formula per device (basic algebra)



来源:https://stackoverflow.com/questions/17923923/calculate-the-distance-between-the-iphone-and-a-door-knowing-their-physical-wid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!