We're building a camera app, and we want to use manual exposure. We don't want the exposure algorithm to set the ISO and exposure duration; instead we want it to tell us what the difference is between the manual exposure that we set and the correct exposure according to the algorithm. That way, we can take this into account in our calculations.
iOS has such an API exposureTargetOffset. Does Android camera2 have such an API?
I don't think that the camera2 library has such an API. However, you can calculate the difference between your ISO and exposure values, and the algorithmic ones.
Follow the below steps:
this.previewCaptureSession.setRepeatingRequest(previewSession.build(),
customCaptureCallback, this.cameraHandler);
CameraCaptureSession.CaptureCallback customCaptureCallback = new CameraCaptureSession.CaptureCallback() {
@Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session,
@NonNull CaptureRequest request,
@NonNull TotalCaptureResult result) {
super.onCaptureCompleted(session, request, result);
//you can store the values of these two below variables however you want
final Long exposureValue = result.get(CaptureResult.SENSOR_EXPOSURE_TIME);
final Integer isoValue = result.get(CaptureResult.SENSOR_SENSITIVITY);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With