在我上的银河S7尝试:
给定的传感器尺寸被3.2毫米X2.4毫米(使用SENSOR_INFO_PHYSICAL_SIZE)。
在这种情况下,我的计算HFOV是41.7°(给出的焦距是4.2mm),我通过实验证明是错误的。
各种规格文档提及了1/2.5" 传感器尺寸(5.76毫米X根据wikipedia4.29毫米) - 这将给我一个HFOV的68.9°,更接近我实验
在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
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));
}
2016-11-09
rotoglup