DEV Community

SoraYe
SoraYe

Posted on

How to do AE and ToneMapping synchronization

How to stabilize image brightness in an imaging system? How to address image flicker or brightness oscillation resulting from the temporal mismatch between an Automatic Exposure (AE) result and a subsequent Tone Mapping (TM) operation?

The TM operation is typically calculated based on a histogram derived from image statistics. The AE result is not merely applied to the exposure settings, but is also delayed to TM. There is a mismatch between these two algorithms, which may cause overshoot or unstable image brightness, especially when switching the light.

A simple method is directly integrated into the Tone Mapping calculation by applying the AE result to the image histogram or the brightness mean used for TM calculation and curve generation. By linking the AE and TM processes, the TM curve is dynamically adjusted in immediate response to the AE calculation, thereby reducing the temporal mismatch and minimizing image brightness oscillation. That means it can have a scale factor from AE and then apply it to TM. A simple formula should be

scaleFactor = aeResult/currentMean;
newGamma = scaleFactor * baseGamma;
Enter fullscreen mode Exit fullscreen mode

scaleFactor is 1.0f by default.

Details:
A computer-implemented method for stabilizing image brightness in an imaging pipeline, comprising:
(a) calculating an Automatic Exposure (AE) result for an input image frame, the AE result comprising an intended brightness adjustment;
(b) calculating a brightness histogram and a brightness mean of the image frame;
(c) modifying the calculated brightness histogram or the brightness mean by applying the AE scale factor to the histogram or the brightness mean;
(d) generating a Tone Mapping (TM) curve based on the modified histogram or the modified brightness mean;
(e) applying the generated TM curve to the image frame, thereby synchronizing/linking/coupling the AE result and the TM calculation to reduce image brightness oscillation.

Top comments (0)