rpng/android-camera-calibration

"characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION)" returns null

Closed this issue · 2 comments

sir, it seems that I can't get phone intrinsic directly by using "characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION)" https://github.com/rpng/android-camera-calibration/blob/a80ce7a4f257f265bb7219d7142bbdfc5bb03dba/app/src/main/java/io/rpng/calibration/managers/CameraManager.java#L173 ; and as a result, I get NULL or [0,0,0,0]. The phone I used is Google Pixel. So I wonder can this work well for you?
--Best regards

So that is just asking for the "internal" calibration.
This is something that isn't tested, but should be specified if the device is factory calibrated.
I have personally never got it to work, but I thought it was an interesting API endpoint, so I thought I would put it in.

Now, if you perform normal camera calibration (collecting images of the grid) then this package will solve for a camera matrix for you (Calibration Matrix: vs Device Matrix (api 23): on the results screen).

// Display the values
mTextResults.setText("Calibration was successful!!\n\n" +
"Image Size (px):\n" + widthRaw + " x " + heightRaw + "\n\n" +
"Set Focal Length (mm):\n" + Float.parseFloat(focus) + "\n\n" +
"Average Reprojection Error:\n" + rms + "\n\n" +
"Calibration Matrix:\n" + cal_mat.dump() + "\n\n" +
"Calibration Distortion:\n" + cal_dist.dump() + "\n\n" +
"Device Matrix (api 23):\n" + dev_mat.dump() + "\n\n" +
"Device Distortion (api 23):\n" + dev_dist.dump() + "\n\n"

@CvierXi where you able to get the camera calibration parameters especially ANDROID_LENS_INTRINSIC_CALIBRATION