About Noise Reduction

From RawPedia
Revision as of 16:16, 4 February 2021 by Jdc (talk | contribs)
Jump to navigation Jump to search
Comparison of the Rawtherapee noise reduction tools

February 2021

Preamble

To put the Local Adjustments denoise tools into context, it is useful to summarize the other denoise tools available elsewhere in RT (Detail and Wavelets tabs) and to provide some additional information on the algorithms used. This information is complementary to the existing documentation, which can be found in the relevant sections of Rawpedia.

Tools initially designed by Emil Martinec in 2012 located in "Ftblockdn.cc".

  • Wavelets in RGB mode
  • Fourier Transform (DCT)

Other tools

  • Guided filter
  • Median filters
  • Bilateral filter
  • Gaussian blur
  • Dark frame
  • Hot/Dead pixels, etc.

We will look at the first two: Wavelets & Fourier.

The original module designed by E.Martinec between 2008 & 2012

It is composed of basic functions (Wavelets, DCT) which can also be called by other programs, such as "Wavelet Levels" and "Local Adjustments". These functions were originally designed to provide:

  • Wavelet processing with the following characteristics:
    • global action, i.e. identical for all decomposition levels and for the whole range of luminance or chroma values.
    • global noise assessment - per decomposition level - using MAD (median absolute deviation).
    • one or two passes ("conservative" and "aggressive").
  • Fourier processing for luminance noise using DCT (Discrete Cosine Transform) to process the residual noise (equal to the difference between the original image and the wavelet-denoised image).

These 2 functions were contained in a general module (Noise Reduction in the Detail tab):

  • using luminance and chrominance with a single slider for each
  • using automatic tiling for both wavelet and DCT operations to reduce memory requirements.

Note that in the beginning, the "Denoise" module was at the end of the process (this was also the case for the PerfectRAW product which I worked on with E.Martinec and M.LLorens).

Enhancements to original features carried out between 2012 & 2020

Several improvements were made by Ingo Weyrich and Jacques Desmis:

  1. possibility of denoising by level of decomposition.
  2. ability to denoise at pixel level by taking into account the luminance and chrominance.
  3. ability to extend the DCT Fourier processing to chrominance.
  4. addition of a DCT threshold to take into account the edge effect (origin ART ).

Improvements to the general noise reduction module (Noise Reduction - Detail tab)

  • Automatic calculation of noise suppression settings.
  • 2 additional curves to process more finely the luminance and chrominance noise - 'y' axis = amplitude, 'x' axis = luminance or chrominance intensity.
  • Ability to use L*a*b* mode instead of RGB mode.
  • Addition of median filter denoising

A few remarks

Denoising is subject to a lot of debate, often controversial. There is also a lot of dogma and quarrels surrounding the methods and tools. My position on the following subjects is to be pragmatic. What counts is the final result.


Where should the denoise functions be located?

At the beginning, or at the end of the process? Each has its advantages and disadvantages.

  • At the beginning: denoise is carried out in linear mode, but does not take into account subsequent processing (sharpening, exposure, saturation etc.) that may increase the noise or its appearance. This results in a tendency to overcompensate for noise.
  • At the end: denoise is carried out in non-linear mode and takes into account all the processing operations including any noise artifacts that appeared early in the pipeline and were amplified by subsequent processing.
  • The ideal would be to combine the two: minimal denoise at the beginning, then additional denoising at the end.

RGB mode or Lab mode?

Each method has its advantages and disadvantages, again we need to be pragmatic.

  • The linear RGB mode should theoretically be better, mainly because of the superiority of MAD noise evaluation. However, we need to keep in mind that the way our eyes and brain react to noise can be modeled in the same way as CAMs (colored appearance models) i.e. the same noise level will be perceived differently according to whether the background is black, gray or white and varies with color and saturation.
  • The Lab mode , which requires the addition of contrast and luminance management tools (gamma, curves, sliders etc.), can be better in many cases. In addition, Lab seems to discriminate color noise better.

How many wavelet levels?

  • It is often said that only the first 4 levels are useful. This is true enough for luminance noise when the 'CAM' effect is taken into account.
  • However, if we apply noise reduction to the luminance components above level 4 we can definitely see a difference.
  • For chrominance noise, the first 4 levels are suitable for the noise which generates distributed colored pixels. For packets of noise (blotches), we can only get rid of these by going up to level 7.

Main characteristics of the various RT noise reduction tools

Noise Reduction (Detail tab)

  • No differentiation by level of decomposition.
  • Pixel differentiation for luminance.
  • 5 decomposition levels for luminance, 6 for chrominance.
  • DCT used for luminance only.
  • No DCT threshold.
  • Automatic tiling for wavelets.
  • Automatic adjustment option.


Denoise & Refine (Wavelet Levels, Advanced tab)

  • Differentiation by level of decomposition for Luminance and Chrominance (fine and coarse).
  • Pixel differentiation for luminance and possibility of taking hue into account.
  • 6 decomposition levels used for luminance, 6 for chrominance.
  • Differentiation using local contrast.
  • no DCT.
  • Tiling option.

Blur/Grain & Denoise (Local Adjustments tab) + Non-local means

  • Differentiation by level of decomposition for luminance and chrominance (fine and coarse).
  • Pixel differentiation for luminance and possibility of taking hue into account.
  • 7 decomposition levels used for luminance, 7 for chrominance.
  • DCT for luminance and chrominance.
  • DCT threshold for luminance and chrominance.
  • Recovery of all or part of the original image (prior to denoise) with the help of masks.
  • Local differential selection (Rtspot).
  • Use of deltaE and masks to improve selection (RTspot).
  • Use of an Excluding Spot to recover noisy areas.
  • No tiling: this means that when you work in full-image mode and the image is > ~30Mb, you will need more than 8Gb of RAM to work without crashing.
  • Since february 2021 - Non-local means (Patch-based denoise):
    • What is patch-based denoise? Contrary to the usual filters that reduce noise by averaging the values of groups of pixels located around a target pixel, non-local means filters average the values of all the pixels in the image and weight them according to their similarity with the target pixel. This type of filtering reduces the loss of detail compared to filters that use local averaging.

Which modules should you use?

It is very difficult to answer this question, unless you want to denoise just part of the image. In this case you need to use Blur/Grain & Denoise in the Local Adjustments tab. Nevertheless :

  • with noisy or very noisy raw images from older cameras with smaller sensors, the Noise Reduction module in the Detail tab is essential and easy to use.
  • with recent low-noise raw files, the Blur/Grain & Denoise module in the Local Adjustments tab is by far the most complete even if it is a little complex.
  • the Denoise & Refine module in Wavelet Levels (Advanced tab) has the advantage of being part of the same interface as the other wavelet-processing tools thereby making it easier to tweak the settings in conjunction with the other wavelet parameters.
  • there is no point in using all 3 together. However, for noisy images the combination of Noise Reduction and one of the other modules either in Wavelet Levels or Local Adjustments is recommended.


Denoising with « Local adjustments » and "Non-local means"

Steps in the process

(in the order they appear in the menu)

These tools allow:

  • denoise by level of detail
  • differentiate the action on flat areas and structures

Aggressive / Conservative mode (uses wavelet processing)

The "aggressive" setting is not necessarily more destructive than the "conservative” setting. It all depends on the Strength settings for both luminance and chrominance. In some cases two passes with a lower Strength setting will lead to a better result. However, the processing time will be significantly increased in this case.

Luminance denoise by level (uses wavelet processing)

The abscissa ("x" axis) represents the levels of decomposition (from 0 to 6, left to right). The y-axis represents the amount of denoise applied at each level.

Luminance detail recovery (DCT f - Fourier transform & wavelets)

This slider uses the Fourier transform to take into account the difference between the L (Lab) component of the wavelet-denoised image and the original image. It is important not to set this slider to zero because in this case, the Fourier transform will have a very strong effect on the noise and prevent the 3 equalizers from having any real influence. The more the slider is moved to the right, the weaker the DCT action will be and the more the details will be apparent.

Equalizer white-black (uses data prior to wavelet processing)

This slider corresponds to the luminance curve of the Noise Reduction module in simplified form. It allows you to focus the action on either the dark or light tones of the image. The action of the “Luminance denoise by level” curve will be modulated according to the position of the slider.

Denoise hue equalizer (uses data prior to wavelet processing)

This curve allows you to increase or reduce the action of the "luminance denoise by level " curve as a function of the color (hue) of the image, .

Denoise based on luminance mask (uses data prior to wavelet processing)

  • The mask in "mask and modifications" (Blur & denoise ) must be activated.
  • One or both of the two curves L(L) - LC(H) must be activated.
  • The slider "Dark area luminance threshold" allows you to choose the luminance level. below which the action of the "Luminance denoise by level" curve will be reinforced.
  • The slider "Light area luminance threshold" allows you to choose the luminance level above which the action of the curve "Luminance denoise by level " will be reinforced.
  • Between the two values, the denoise action will depend on the curve settings.
  • Reinforce denoise in dark and light areas.

Depends on the individual image and whether or not there are uniform dark and/or light areas. If the image contains an almost perfectly uniform dark area, the background of the corresponding mask will be completely black (L = 0). If the dark area is not completely uniform this value will vary. The slider will progressively increase the action of the denoise curve between the dark or light threshold and the completely uniform area. Values less than 1 decrease the action of the curve.

Edge detection/ Luminance and chroma detail threshold (DCT f - uses Fourier transforms and wavelets)

This slider tries to take into account the edge effect of the original image in order to differentiate the action between uniform areas and areas with detail. Two algorithms are available (both from ART.)

  • "buildblendmask" - similar function to that used to differentiate demosaicing, for example.
  • "Laplacian"
  • The first will generally be more progressive, the second more selective, especially when the cursor is very close to the maximum.

Non-local means - patch-based denoise

Can be used in conjunction with Wavelet and DCT or alone. It allows a very efficient noise reduction of the luminance. It will notably allow a differentiation between flatness and texture.

Fine chroma (uses wavelets)

This slider acts on the first 4 levels of decomposition and will generally reduce or remove dots of colored noise.

Coarse chroma (uses wavelets)

This slider acts on the last 3 decomposition levels and will generally reduce or remove the blotches or packets of colored noise.

Equalizer Blue-yellow / Red Green (uses wavelets)

Changes the distribution of color noise processing.

Chroma detail recovery (DCT – uses Fourier transforms and wavelets)

This slider uses the Fourier transform to take into account the difference between the "a" and "b" (Lab) components of the wavelet-denoised image and the original image. It is important not to set this slider to zero because the Fourier transform will have a very strong effect on the noise and prevent the edge detection from having any real influence. The more the slider is moved to the right, the weaker the DCT action will be and the more the color details will be apparent.

Recovery based on luminance mask (uses data before and after denoise processing)

This module acts on the difference between the original noisy image and the denoised image processed with the above tools. Completely black areas in the mask will retain the denoise settings whereas completely white areas will retain the image settings prior to denoising.

  • The mask in "mask and modifications" (Blur & denoise ) must be activated.
  • One or both of the two curves L(L) - LC(H) must be activated.
  • The "dark area luminance threshold" slider allows you to choose the luminance level below which the denoise settings will be progressively applied.
  • The "light area luminance threshold" slider allows you to choose the luminance level above which the denoise settings will be progressively applied.
  • Between the two values, the image will be preserved without denoising, unless the "Gray area denoise" slider is greater than 0; this can be useful for example to attenuate any unsightly chromatic noise.
  • The "Recovery threshold" slider allows you to choose the level of denoise that will be applied below or above the "dark" and "light" thresholds respectively.
  • The "Decay" slider allows you to choose the rate at which the attenuation or amplification will be progressively applied.

Note on masks

  • You can use a lockable color picker (LCP) to help identify the extent to which the different parts of the mask will attenuate or maintain the denoise settings. To ensure that the LCP information corresponds to the slider values, the “Background color for luminance and color masks” must be set to zero in Settings.
  • You can use the Mask Tools (see below) in association with the LCP, to adjust the gray areas and make them lighter or darker, thereby adjusting the amount of denoise that is applied.

Mask tools: structure mask, smooth radius, gamma, slope, shadows, L(L) contrast curve, “local contrast by wavelet” curve.

Conclusion

The "Local adjustments" module allows you to :

  • make local adjustments to the noise and differentiate the action by luminance and color.
  • process the entire image and use the unique features of the local adjustments module:
    • deltaE
    • excluding spot
    • transitions
    • masks.

Guided Filter

When the values of the "Detail" slider are negative, this tool generates a blur that will mask the luminance and chrominance noise to give a denoising effect.

  • "Recovery based on luminance mask" works similarly to "Denoise".