Android camera2 CameraCharacteristics API对传感器尺寸的可靠性如何?

Android camera2 CameraCharacteristics API对传感器尺寸的可靠性如何?,第1张

概述我正在尝试使用camera2 API获取/计算设备摄像机的FOV,我的代码位于底部). 在我尝试Galaxy S7时: >给定的传感器尺寸为3.2mm x 2.4mm(使用SENSOR_INFO_PHYSICAL_SIZE). >在这种情况下,我的计算HFOV是41.7°(给定的焦距是4.2mm),我通过实验证明是错误的. >各种规格文件提到1 / 2.5“传感器尺寸(根据wikipedia,5. 我正在尝试使用camera2 API获取/计算设备摄像机的FOV,我的代码位于底部).

在我尝试galaxy S7时:

>给定的传感器尺寸为3.2mm x 2.4mm(使用SENSOR_INFO_PHYSICAL_SIZE).
>在这种情况下,我的计算HFOV是41.7°(给定的焦距是4.2mm),我通过实验证明是错误的.
>各种规格文件提到1 / 2.5“传感器尺寸(根据wikipedia,5.76mm x 4.29mm) – 这将给我一个68.9°的HFOV,更接近我的实验.
> Cameracharacteristics中的值似乎有误.

三星galaxy A3-2016上的相同查询和实验更具决定性,计算出的HFOV似乎与实验相匹配.

有没有人可以分享有关Cameracharacteristics读数可靠性的经验或数据?

我用来查询Cameracharacteristics的代码::

Cameracharacteristics characteristics = manager.getCameracharacteristics(cameraID);if (characteristics.get(Cameracharacteristics.LENS_FACING) == Cameracharacteristics.LENS_FACING_FRONT)    continue;int support = characteristics.get(Cameracharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);if( support == CameraMetadata.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY )    Log.d("mr","Camera " + cameraID + " has LEGACY Camera2 support");else if( support == CameraMetadata.INFO_SUPPORTED_HARDWARE_LEVEL_liMITED )    Log.d("mr","Camera " + cameraID + " has liMITED Camera2 support");else if( support == CameraMetadata.INFO_SUPPORTED_HARDWARE_LEVEL_FulL )    Log.d("mr","Camera " + cameraID + " has FulL Camera2 support");else    Log.d("mr","Camera " + cameraID + " has unkNown Camera2 support?!");// voir http://myandroIDarchive.tistory.com/5 pour le query androID// voir http://paulbourke.net/miscellaneous/lens/ pour les maths// include every focal length supported by the camera device,in ascending order.float[] focalLengths = characteristics.get(Cameracharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS);Sizef sensorSize = characteristics.get(Cameracharacteristics.SENSOR_INFO_PHYSICAL_SIZE);float w = 0.5f * sensorSize.getWIDth();float h = 0.5f * sensorSize.getHeight();Log.d("mr","Camera " + cameraID + " has sensorSize == " + float.toString(2.0f*w) + "," + float.toString(2.0f*h));for (int focusID=0; focusID<focalLengths.length; focusID++) {    float focalLength = focalLengths[focusID];    float horizonalAngle = (float) Math.todegrees(2 * Math.atan(w / focalLength));    float verticalAngle = (float) Math.todegrees(2 * Math.atan(h / focalLength));    Log.d("mr","Camera " + cameraID + "/f" + focusID + " has focalLength == " + float.toString(focalLength));    Log.d("mr","  * horizonalAngle == " + float.toString(horizonalAngle));    Log.d("mr","  * verticalAngle == " + float.toString(verticalAngle));}
解决方法 Scanbot的开发人员(也就是我用相机工作了).

根据我的经验,关于Camera API的任何内容都不可靠,因为这个API在硬件和供应商特定的相机驱动程序上是一个相对薄的层.换句话说,API的输出将取决于供应商决定放在哪里,而不是(与AndroID SDK的其他部分不同)由Google管理.

总结

以上是内存溢出为你收集整理的Android camera2 CameraCharacteristics API对传感器尺寸的可靠性如何?全部内容,希望文章能够帮你解决Android camera2 CameraCharacteristics API对传感器尺寸的可靠性如何?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1128158.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存