本文介绍了Android camera2镜头内在校准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一款Android相机2 ,运行良好。

I downloaded an Android camera2 demo, it ran well.

现在我想通过查询。

我的代码是

private void setUpCameraOutputs(int width, int height) {
    Activity activity = getActivity();
    CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);
    try {
        for (String cameraId : manager.getCameraIdList()) {
            CameraCharacteristics characteristics
                    = manager.getCameraCharacteristics(cameraId);
            float[] intrinsic = new float[5];
            intrinsic = characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION);
    //...... leave out the following part
        }
    }

内在函数应该是一个5元素数组但 intrinsic = characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION)返回null。

The intrinsic is expected to be a 5-element array but intrinsic = characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION) returns null.

推荐答案

只有在相机设备支持。

The lens intrinsics are only guaranteed to be defined if the camera device supports the DEPTH_OUTPUT capability.

截至目前,camera2 API的深度扩展是新的,基本上任何Android设备都不支持。

As of right now, the depth extensions to the camera2 API are new, and not yet supported by basically any Android device.

这篇关于Android camera2镜头内在校准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 17:44