Experimenting with Local Laplacian Filters

I am bumping this relatively old discussion, because I have re-written part of my Local Laplacians implementation and put the code on GitHub: PhfMerge/phf_llf.cc at master · aferrero2707/PhfMerge · GitHub

The main difference with respect to the old code is that the new code offers the possibility to linearly adjust the amount of local contrast enhancement between the smallest and largest scale. In other words, it is possible the enhance the coarse scale much more than the finer, giving emphasis to the “structure” of the image more than the “texture”.

Here is a first example from the [Fading Embers}([Play Raw] Fading Embers) PlayRaw.

Original:

Same local contrast enhancement on all scales:


Command:

phf_llf -c 1.5 -C 2.5 2.5 -t 0.5 -o DSC_5382-llf-2.tif DSC_5382-small.tif

Local contrast enhancement more accentuated on the coarse scales:


Command:

phf_llf -c 1.5 -C 5 1.5 -t 0.5 -o DSC_5382-llf.tif DSC_5382-small.tif

This is instead an example of dynamic range compression, using the image from this other PlayRaw.

Original:

Compressed dynamic range:


Command:

phf_llf -c 2 -C 1 1 -t 0.5 -o DSZ_0619-llf.tif DSZ_0619-small.tif 

Finally, this is a version with both DR compression and LC enhencement:


Command:

phf_llf -c 2 -C 3 1.2 -t 0.5 -o DSZ_0619-llf-2.tif DSZ_0619-small.tif

Ping @Entropy512 @hanatos as they are likely interested in those developments.

I can give more details on the implementation and the specificities of the algorithm, if anyone is interested. I will also try to provide pre-compiled packages to allow people to easily play with the code…

Meanwhile, If you have test images to suggest I’ll be glad to post examples of what can be achieved.

The local laplacian pyramid is applied, like in my previous version of the code, to log encoded values, as this produces results that are more “perceptually” uniform. There is however another advantage: the result is independent of the overall brightness of the image. In other words, if the image is too dark or too bright, you can apply an exposure compensation either to the input or the output of the dynamic range compression, and the result will be the same. Mathematically, this comes from the fact that logarithms transform ratios into differences.
In practical terms, this means that the result of the dynamic range compression is suitable for further processing, including exposure adjustments and film-like tone mapping.

7 Likes