Android camera2 Lens intrinsic calibration

青春壹個敷衍的年華 提交于 2019-12-20 03:56:11

问题


I downloaded an Android camera2 demo, it ran well.

Now I want to get the intrinsic matrix of the camera by querying the CameraCharacteristics.

My code is

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
        }
    }

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


回答1:


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

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



来源:https://stackoverflow.com/questions/34070557/android-camera2-lens-intrinsic-calibration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!