测量两个iOS设备之间的距离 [英] Measuring distance between two iOS Devices

查看:211
本文介绍了测量两个iOS设备之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我想知道现在这个。
在我的使用情况下,设备将50厘米10米外,我想它是精确到至少10厘米。 (因此GPS是不是一个选项)

Yeah, I'm currently wondering about this. In my use case the devices will be 50cm to 10m apart and I'd like it to be accurate to at least 10 cm. (Therefore GPS is not an option)

2的方式映入脑海:

声音:我询问了在开发论坛,我在与laanlabs接触,对他们的声纳统治者

Sound: I asked about this in the dev forums and I'm in contact with laanlabs, about the code of their sonar ruler.

一台设备+相机上的其他图片上:似乎更容易成立,因为我的用户此案涉及反正在面对90度的一个设备的用户。但它是对用户面对卡梅罗入方向,它不会以在距离的变化作出反应更多的工作。

Picture on one device + Camera on the other: Seems easier to set up, since my user case involves the user facing one device at 90 degrees anyway. But it would be more work for the user to face the camero into the direction and it would not react to a change in distance.

现在的问题是:有没有人知道任何code,做这样的事情已经呢?可能是一个非iPhone一般的C-项目?

Now the question: Is anyone aware of any code that does something like this already? Possibly a non-iPhone general c-Project?

推荐答案

带摄像头的方法:我们已经知道了每个器件的尺寸。你把装置的图像,计算它的高度/宽度来确定类型的设备(iPhone / iPod的或ipad),比计算距离

Method with camera: we already know size for each device. You take a picture of device, calculate it's height/width to determine type of device (iPhone/iPod or iPad), than calculate a distance.

例如 - 如果设备是iPhone你知道,它的尺寸为115x58毫米。上图片吧N×M个像素。现在,你可以计算出距离。 (如果N&放大器; M时,因此距离较大)

For example - if device is iPhone you know, that its size is 115x58 mm. On picture it NxM pixels. Now you can calculate the distance. (If N & M smaller hence distance is larger)

这篇关于测量两个iOS设备之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆