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

95 views
Skip to first unread message

dokinkon lin

unread,
Mar 24, 2022, 2:09:27 AM3/24/22
to Android CameraX Discussion Group
I tried to migrate my app from Camera2 to CameraX, however the preview is pretty dark in low brightness environment (CameraX).  I try to use exposure compensation to make preview can be lighter as Camera2 version. The exposure composition is working fine on normal condition. (Indoor lighting). But if I turn off indoor lighting, make environment dark, the exposure compensation is not work anymore. The preview stays dark. 

I also tried use Camera2Introp to apply my Camera2 configuration, but no help.

Does anyone have idea?

Thank you.

Wenhung Teng

unread,
Mar 24, 2022, 8:18:07 AM3/24/22
to Android CameraX Discussion Group, doki...@gmail.com
Hi,
Thanks for the report. Did you try to receive the result of the ListenableFuture that returns from the setExposureCompensation()?
The ListenableFuture will be completed once the camera reaches the exposure value.
And can you share the device models having this issue? We probably may need a try if this issue only happens on specific models.
doki...@gmail.com 在 2022年3月24日 星期四上午10:09:27 [UTC+8] 的信中寫道:

Eino-Ville Talvala

unread,
Mar 24, 2022, 2:05:48 PM3/24/22
to Wenhung Teng, Android CameraX Discussion Group, doki...@gmail.com
This could be a question of what frame rate range your app ends up using.  If the frame rate range is locked to [30,30], for example, the maximum exposure time is 1/30s. But if the frame rate is allowed to vary for a range such as [10,30], then the maximum exposure time is 1/10s.  

Exposure compensation cannot brighten the image past the maximum exposure time defined by the frame rate range.

Regards,
Eddy Talvala


--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/4811ff83-05aa-4664-8445-bc51ca77ae3dn%40android.com.

dokinkon lin

unread,
Mar 25, 2022, 1:56:40 AM3/25/22
to Eino-Ville Talvala, Wenhung Teng, Android CameraX Discussion Group
Hi Mr. Talvala and Teng 

Thank you for this frame-rate guess. As you said, the root cause is this device frame-rate lock on some specific range. (15, 15), (24, 24), (30, 30).

So in low light environment, the camera cannot get enough exposures. 

You save my life. Thank you again.



Eino-Ville Talvala <etal...@google.com> 於 2022年3月24日 週四 下午10:05寫道:

Bhushan Bhadane

unread,
Mar 12, 2025, 5:10:50 AMMar 12
to Android CameraX Discussion Group, dokinkon lin, wenhu...@google.com, Android CameraX Discussion Group, etal...@google.com
Has your issue been resolved? If yes, what did you do? If I 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()

Reply all
Reply to author
Forward
0 new messages