androidimage-processingandroid-camera2camera2

Auto exposure implementation


I'm working on custom AE implementation using android Camera2 API. Current idea is hold the mean brightness of image at some gray level (128 for example). So algorithm could be described as this:

calculate currentEV (using current shutterSpeed, currentISO and aperture);
calculate meanBrightness (using image data);
calculate desiredEV (using currentEV, currentMeanBrightness and desiredMeanBrightness);
calculate desiredShutterSpeed and desiredISO (using desiredEV)

This iterative algorithm is working. But if compare it with built-in, it looks pretty slow and clumsy. I searched for information about 3A routines in Camera2 API on the internet and in android source code, but can't find something specific. Some presentations mention about 3A-library. I'd like to know, is it open-sourced and standart for all android devices? Or where I can get info about Auto Exposure implementation in mobile devices?


Solution

  • Unfortunately, auto-exposure algorithms are generally closely guarded secrets, and I'm not aware of any implementations of Android camera HALs that include open-source auto-exposure code.

    The built-in auto-exposure can also use hardware-generated statistics and close familiarity with the device which it runs on (the algorithms are generally customized for each device, more so for high-end devices), which can allow for shorter feedback loops and more efficient operation.

    Since these statistics/etc vary greatly from device to device, there's no current camera2 API interface to receive them.