简体   繁体   中英

Android camera2 Lens intrinsic calibration

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM