如何检查给定的摄像机是普通摄像机还是广角摄像机? [英] How to check whether given Camera is regular camera or wide angle camera?

查看:313
本文介绍了如何检查给定的摄像机是普通摄像机还是广角摄像机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以检测给定的摄像机是普通摄像机还是广角摄像机?

Is there any way to detect whether the given camera is regular camera or wide angle camera?

通过Oppo,Vivo,LG等设备,他们可以使用Camera2 API来访问其每台相机.但是如何知道哪个相机是主相机,哪个相机是广角相机?

With devices like Oppo, Vivo, LG, etc. they provide the access to each of their camera using Camera2 API. but how to know which camera is primary camera and which camera is wide angle camera?

推荐答案

您可以计算每个摄像机的视场,并确定它的宽度是否足以计数.

You can calculate the field of view of each camera, and decide if it's wide enough to count.

以度为单位的水平视场的标准公式为:

The standard formula for horizontal field of view in degrees is:

FOV = 2 * arctan(sensor_width / (2 * lens_focal_length) )

,对于垂直FOV,请使用传感器高度.

and for the vertical FOV, use the sensor height.

通过camera2 API,焦距在中列出AVAILABLE_FOCAL_LENGTHS PHYSICAL_SIZE .

From the camera2 API, the focal length is listed in AVAILABLE_FOCAL_LENGTHS and the sensor physical dimensions in PHYSICAL_SIZE.

如果您想完全准确,还应该考虑物理像素阵列.但这通常只有几千个像素中的几行.但是,如果要考虑到这一点,则需要类似以下内容的东西:

If you want to be completely accurate about it, you should also factor in the active array, which is the subset of the physical pixel array that is actually used to produce an image. But that's usually only a few rows of pixels out of thousands. But if you want to take it into account, you'll want something like:

active_width = sensor_width * active_array_width / pixel_array_width

用于计算FOV.另外,有时报告的FOV是对角线,在这种情况下,您想要的传感器尺寸为

to calculate the FOV with. Also, sometimes the FOV reported is the diagonal one, in which case the sensor dimension you want is

sensor_diagonal = sqrt(sensor_width^2 + sensor_height^2)

什么才是广角相机没有一个单一的定义,尤其是因为大多数移动设备相机已经在65-75度FOV范围内.

There's no single definition for what counts as a wide-angle camera, especially since most mobile device cameras are already in the 65-75 degree FOV range.

三星S8前置摄像头的FOV为80度,三星称之为全自拍",而后置摄像头的FOV为77度.但是不确定这些是水平还是对角FOV.

The Samsung S8 front camera has an 80 degree FOV, and Samsung calls it 'wide selfie', while the back camera has a 77 degree FOV. But not sure if these are horizontal or diagonal FOVs.

这篇关于如何检查给定的摄像机是普通摄像机还是广角摄像机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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