martin-marek / hdr-plus-swift

📸Night mode on any camera. Based on HDR+.
https://burst.photo
GNU General Public License v3.0
209 stars 11 forks source link

Improved averaging of exposure bracketed bursts #40

Closed chris-rank closed 1 year ago

chris-rank commented 1 year ago

This PR improves the "simple" averaging (without alignment) of exposure bracketed bursts.

It includes two fixes for regions with clipped highlights when these regions change their position between frames due to strong motion:

The mode "simple" averaging (without alignment) is obviously not designed for scenes with strong motion as it leads to ghosting in the image. For these situations, the robust merging algorithms (NR 1 - 22) are highly recommended. Still there might be scenes with only very slight motion, for which the most efficient noise reduction is desirable, e.g. landscapes with slightly moving trees. For these situations, the fixes yield a welcome improvement. When the ghosting effect shall be used as an artistic effect, the "simple" averaging of bursts with uniform exposure may be better suited as each frame gets exactly the same weight in the final image.

The example below shows a strong crop of a scene with a spinning top, which reveals very strong motion between the frames. It is recommended to inspect the example at 100% zoom level.

Bildschirmfoto 2023-10-22 um 22 52 15

Alex-Vasile commented 1 year ago

How come the highlighted areas in most of the areas appear as holes rather than as brighter regions?

chris-rank commented 1 year ago

These bright regions are excluded from averaging as the aim of an exposure bracketed burst is to maximize dynamic range. You would prefer to take the highlight information from the darkest frame and exclude the clipped highlights from brighter frames. All these effects are not visible when there is no motion.

Alex-Vasile commented 1 year ago

These bright regions are excluded from averaging as the aim of an exposure bracketed burst is to maximize dynamic range. You would prefer to take the highlight information from the darkest frame and exclude the clipped highlights from brighter frames. All these effects are not visible when there is no motion.

Hmm. Yes you're right. I was still thinking about it as a temporal average (which it's not really).