确定来看智能手机摄像头的角度 [英] Determine angle of view of smartphone camera

查看:357
本文介绍了确定来看智能手机摄像头的角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图确定现场-的观点令人难以置信的Droid智能手机的摄像头的程度大小。我需要知道该值以我开发的应用程序。有谁知道我可以找出/编程计算呢?

I'm trying to determine the degree size of the field-of-view of a Droid Incredible smartphone's camera. I need to know this value for an application that I'm developing. Does anyone know how I can find out/calculate it programmatically?

推荐答案

除非有一些API调用了(我不是一个Android程序员,我不知道),我只是想捕捉统治者从图片已知的距离,看到多少的标尺显示在画面,然后用三角找到像的这个

Unless there's some API call for that (I'm not an Android programmer, I wouldn't know), I would just snap a picture of a ruler from a known distance away, see how much of the ruler is shown in the picture, then use trigonometry to find the angle like this:

现在你有两个距离L和D从图中。用一些简单的测角器,可以得到:

now you have the two distances l and d from the figure. With some simple goniometry, one can obtain:

黄褐色(α/ 2)=(​​1/2)/ d的,

tan(α/2) = (l/2)/d,

因此​​

α= 2 * ATAN(L / 2D)

α = 2*atan(l/2d)

所以这个公式就可以计算出水平场,视你的相机。当然,测量垂直f.o.v.变为完全相同的方式,只是然后需要查看的对象在其垂直位置。

So with this formula you can calculate the horizontal field-of-view of your camera. Of course measuring the vertical f.o.v. goes exactly the same way except that you then need to view the object in its vertical position.

然后你可以硬$ C C $它在你的程序中的常量。 (一个名为当然不变,所以它会很容易改变:磷)

Then you can hard-code it as a constant in your program. (A named constant, of course, so it'd be easy to change :-p)

这篇关于确定来看智能手机摄像头的角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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