We add (Ingo and me) a new tool to “local adjustements” “denoise”…
It’s name “Non-local means”
Commit “dev” - 6ad419f - 5 February 2021
Local adjustments – Denoise – improvments with Non-local means
What is « Non Local Means » ?
Here Wikipedia definition : Non-local means is an algorithm in image processing for image denoising Unlike “local mean” filters, which take the mean value of a group of pixels surrounding a target pixel to smooth the image, non-local means filtering takes a mean of all pixels in the image, weighted by how similar these pixels are to the target pixel. This results in much greater post-filtering clarity, and less loss of detail in the image compared with local mean algorithms
In french this algorithm is named « Débruitage par morceaux » ou « Débruitage par patch » which seems to me more explicit.
Where it can be found ?
it seems that this alogorithm is used by DxO
The algorithm used here is close to the one implemented by IPOL in 2014
The work of Alberto and Ingo
I had thought of implementing this algorithm, but Alberto @agriggio was faster and made very good improvements with the help of Ingo @heckflosse . Thank you to them for this excellent work
These improvements can be achieved by :
- used of OMP and SSE
- used of Tiles
- used Laplacian and mask to better improve edge detection and thus differentiate the action between solids and textures.
- limit the use to luminance noise, because indeed the examination of other software shows that chromatic noise is often better processed by other algorithms (Wavelets, GuidedFilter…)
I made the choice to implement it in « LA », but it is possible to do it for the other denoise modules of Rawtherapee (Noise reduction, Wavelet levels)
What are the differences with the ART version ? For the code itself few deviations.
I used Lab instead of Yuv, because the base data are in L (Lab)…for this I applied a transformation to make Lab “variable”, by default I applied a gamma=3.0 and at the end inverse-gamma=0.3333, but, with the help of Ingo, you can vary the gamma and thus change the distribution of denoise according to solids and textures. . For recall Lab consists of a system with gamma=3.0 and slope=9.03
In «standard and advanced mode » I use “gamma” as above and I enable the 2 hiden variables in ART « max_patch_radius » and « max_search_radius » (advanced) which allows to better adapt the algo to the details of the image, but which resulted in an increase in the processing time for the 2nd.
And of course everything that will allow you to work with a spot…(the Laplacian has already been used for other applications).
To note that for “Non-local means” the minimum RT-spot size is 150*150 pixels which nevertheless is very small
How is it implanted here ?
I choose to be able to be used in conjunction with ‘Luminance denoise by level’ or on its own.
I also chose to be able to use all the particularities of LA : Scope (deltaE), Transitions, Excluding Spot, Mask and ‘Recovery based on luminance mask’, and of course for one or several RT-Spot or working in « Full image »
The GUI has been modified as a consequence, in particular by changing the selection combobox. It now offers 4 choices :
- Non-local means only
This modification could lead to difficulties with some pp3 - in this case it is better to clean the cache
« Non local means » is enable when slider « strength » is > 0.
Labels and tooltips have been improved with the participation of Wayne Sutton @Wayne_Sutton , thanks to him.
What memory usage and processing time ?
For memory, whatever the settings, the consumption is low, thanks again to Alberto and Ingo.
For processing time, here some comparisons (output TIF)
Image 4312 * 2860 (wavelet - conservative)
Full image : wavelet 3000ms – Nlmeans 3000ms
Spot 1200*800 wavelet 260ms – Nlmeans 220ms
Spot 150*150 wavelet 100ms – Nlmeans 20ms
Image 6000*4000 (wavelet - conservative)
Full image : wavelet 12000ms – Nlmeans 6000ms
What results ?
Like all noise treatments, the result is quite subjective and depends on individual taste. But personally I find the results very good, especially in conjunction with wavelet and DCT.
In the same manner Rawpedia is update