计算iPhone和门之间的距离,知道它们的物理宽度 [英] Calculate the distance between the iPhone and a door, knowing their physical widths
问题描述
我有这种情况:
我知道iPhone屏幕的物理尺寸(不仅仅是像素)。
I know the physical (not only in pixel) size of the screen of the iPhone.
我也知道门的宽度。
现在,如果我有iPhone相机(与UIImagePicker或任何),我的位置,门的宽度完全符合的宽度相机,iPhone是完全垂直的,是否可以知道iPhone和门之间的距离?
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?
推荐答案
取决于设备之间不同的相机规格。为此,我会尝试用标尺来采样一些数据 - 例如采取3'宽的木板,完美对齐边缘和测量距离。在不同的设备上使用不同的宽度来做到这一点,并且每个设备都有一个公式(基本代数)
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)
这篇关于计算iPhone和门之间的距离,知道它们的物理宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!