如何计算手机摄像头的视野?
我需要知道手机摄像头的视野才能制作增强现实应用程序,以便计算我必须在摄像头上写下的位置查看位于城市兴趣点正确坐标上的 GPS 名称屏幕,指向兴趣点。
例如:
距离5米:6米(从左到右FOV)
距离10米:12米(从左到右FOV)
如何计算?
I need to know the field of view of the camera of the phone to make an augmented reality app, for calculate where i have to write on the camera view the name of a gps located Point of interest of a city on the correct coordinates of the screen, pointing the point of interest.
for example:
distance 5 meters: 6 meters (from left to right FOV)
distance 10 meters: 12 meters (from left to right FOV)
How to calculate it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您永远无法匹配每个设备的 FOV 定义。 (比较iPhone 的此答案。)
使用 Android 时,每个设备都不同。带上您的设备,进行数学计算(或从其他任何地方获取结果),然后决定选择合理的 FOV 角度。
也许您可以考虑Camera.Parameters。getSupportedPictureSizes() 用于获取相机比例,但这应该是您所能做的。
I think you will never match the FOV definition for every device. (Compare this answer for iPhone.)
Every device is different when using android. Take your device, do the math (or take the results from anywhere else) and decide yourself to choose a reasonable FOV angle.
Maybe you could take account of Camera.Parameters.getSupportedPictureSizes() for getting the camera ratio, but that should be all you can do.
这个问题很老了,但我遇到了类似的问题,我认为提到了相当合理的解决方案 这里,至少它对我有用:
可以通过java或本机代码通过相机管理器访问镜头信息(焦距、物理尺寸)。就我而言,我使用
ACameraMetadata_getConstEntry
以及ACAMERA_LENS_INFO_AVAILABLE_FOCAL_LENGTHS
和ACAMERA_SENSOR_INFO_PHYSICAL_SIZE
参数收集了必要的值。我希望它可以帮助某人。The question is pretty old but I came across similar problem and I think there is quite reasonable solution mentioned here, at least it worked for me:
It is possible to access lens info (focal length, physical size) through camera manager from java or native code. In my case I collected necessary values using
ACameraMetadata_getConstEntry
withACAMERA_LENS_INFO_AVAILABLE_FOCAL_LENGTHS
andACAMERA_SENSOR_INFO_PHYSICAL_SIZE
parameters. I hope it may help somebody.