Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Exposure compensation is not work when environment lighting is dark on specific device.

38 views
Skip to first unread message
Assigned to leoh...@google.com by scot...@google.com

Bhushan Bhadane

unread,
Mar 12, 2025, 1:13:41 AMMar 12
to Android CameraX Discussion Group
If I set lower the frame rate, the exposure is set properly but after that the preview becomes slow due to the lower frame rate. Do you have any solution to resolve the issue without decreasing the frame rate? I am attaching my code as well.

val cameraManager =
context.getSystemService(Context.CAMERA_SERVICE) as CameraManager
val cameraId = getCameraFacing()

val characteristics = cameraManager.getCameraCharacteristics(cameraId.toString())

// Get the available FPS ranges
val fpsRanges =
characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES)

// Find the best FPS range for low-light conditions (lowest min FPS)
val bestFpsRange =
fpsRanges?.minByOrNull { it.lower } ?: Range(30, 30) // Default if null


preview = Preview.Builder().setResolutionSelector(getResolutionSelector())
.setTargetRotation(rotation).apply {
val camera2InterOp = Camera2Interop.Extender(this)
camera2InterOp.setCaptureRequestOption(
CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, bestFpsRange
)

camera2InterOp.setCaptureRequestOption(
CaptureRequest.SENSOR_EXPOSURE_TIME,
1000000000L
) // 1/10 sec
setWhiteBalance(camera2InterOp, whitebalanceValue)
}.build()

Charcoal Chen

unread,
Mar 19, 2025, 5:10:35 AMMar 19
to Android CameraX Discussion Group, b...@susampinfotech.com
Hi,

If the device supports Camera Extensions NIGHT mode(see link), you can try to enable it to see whether it helps.

Android 15 have new Low Light Boost feature (see link). There might be only few devices support it now. In case the device supports it, you can try it.

For older devices, if CONTROL_SCENE_MODE NIGHT mode is supported, you can also try it to see whether it can improve the problem.

If all the above options are not supported, the target frame rate setting should be the safer (and easiest) choice because OEMs might have their algorithm and settings that are specially tuned for the camera sensor they used.

Manual Exposure Control (SENSOR_EXPOSURE_TIME, SENSOR_SENSITIVITY) might be the advanced approach to adjust the brightness. However, SENSOR_SENSITIVITY setting needs the aeMode to be OFF. It might break other aeMode related operations and it might need your app to have the good algorithm to control all the detailed operations to get the good results.
Reply all
Reply to author
Forward
0 new messages