Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.67k stars 306 forks source link

Raw channel noise reduction #2662

Open Beep6581 opened 8 years ago

Beep6581 commented 8 years ago

Originally reported on Google Code with ID 2679

This is related to issue 2624.

I'm no expert on noise reduction so this may be a bad idea. However it seems to me
a bit backwards to only apply noise reduction after demosaicing, so here's the idea:

Noise in an image is roughly read noise from the sensor A/D conversion and photon shot
noise. Both are dependent on exposure level, ie how close to clipping the signal is.
After demosaicing and white balancing etc raw channels are scaled and mixed so you
don't have the same direct connection to signal level. The red channel may have been
scaled up one stop compared to the green for example.

I'd like to test and see what happens if you apply noise reduction pre-demosaic (as
a raw preprocess step in the raw tab) per raw channel, and with a curve to control
noise reduction amount based on exposure level (ie typically no noise reduction on
the top 4-5 stops or so, and then increase the amount towards the bottom). This would
give you direct control to apply noise reduction based on how much noise there actually
is in the signal.

With the current noise reduction tool I lack control to adjust noise reduction based
on how noisy the signal is, and I can't leave well-exposed areas without noise reduction.
There is some control, but not enough for my own needs which is about refining low
ISO images, not make high ISO images better.

Reported by torger@ludd.ltu.se on 2015-02-20 10:55:12

Beep6581 commented 8 years ago
+1 :)

I think that now the gamma slider is used for adapting to the noise character.
To make a better fit to the noise character we would need a complex curve, linear up
to a point (depending on the read noise) then gamma 2.0 to fit to the shot noise character
(shot noise is sqrt(signal) )  

Reported by iliasgiarimis on 2015-02-20 11:11:22

Beep6581 commented 8 years ago
Anyone who knows who's the person behind the current noise reduction algorithm? I'd
like to include that person as CC on this issue...

Reported by torger@ludd.ltu.se on 2015-02-20 11:15:39

Beep6581 commented 8 years ago
There once was an experimental version dcraw version with RAW noise reduction from http://www.linuxphoto.org/html/fbdd.html
- the same source that provided the DCB demosaicing by the look of things. Unfortunately
the noise reduction didn't make it into rawtherapee. I tried to get it working but
the programming environment of rawtherapee is too alien for me :(

Reported by K.G.Wuensch on 2015-02-20 11:49:28

Beep6581 commented 8 years ago
#2 Anders, it's Emil Martinec's (ejm...) child and Jacques Desmis continued and improved
it .. 

Reported by iliasgiarimis on 2015-02-20 12:12:14

Beep6581 commented 8 years ago
Ok. Emil is no longer active so I won't bother him, if so just send something in private
to ask for advice.

Thanks for the FBDD link. Looks like this could be worth investigating.

Reported by torger@ludd.ltu.se on 2015-02-20 12:17:14

Beep6581 commented 8 years ago
Anders did you get my email?

Reported by entertheyoni on 2015-02-21 22:27:48

Beep6581 commented 8 years ago
yes

Reported by torger@ludd.ltu.se on 2015-02-23 08:21:31

insaneninja117 commented 5 months ago

I know this is an ancient issue but I thought commenting here was better than creating a new one whilst showing off what the results look like with even the most basic form of noise reduction.

The steps taken to produce this example were:

  1. Use LibRaw's 4channel executable to split a Nikon D850 image taken at ISO 10,000 into 4 separate 16 bit tiffs
  2. Apply a 3x3 low pass filter of the coefficients [0 1/12 0; 1/12 8/12 1/12; 0 1/12 0] in Photoshop and save as new 16 bit tiffs
  3. Use ImageMagick along with the rggb2gray script and exiftool as described here: https://im.snibgo.com/procbay.htm to build a new .dng
  4. Process the original and raw low passed images in RawTherapee with identical settings

The results are (in the form of 1080p 1:1 crops):

Original with No RawTherapee noise reduction: Example_NoNR

Low Passed Raw with No RawTherapee noise reduction: Example_RawLP_NoNR

Original with RawTherapee noise reduction (Impulse NR with default settings, Chroma NR in Lab space and conservative default, no luminance NR): Example_NR

Low Passed Raw with RawTherapee noise reduction (Impulse NR with default settings, Chroma NR in Lab space and conservative default, no luminance NR): Example_RawLP_NR

The results are nothing amazing, but this was never meant to be anything other than a quick and dirty demonstration of the difference in final results between applying NR to the raw data vs applying it to the debayered data. To further show this, here is one final image of applying the same low pass filter to the image after the fact rather than before:

Example_NR_LP

I'm sure using a more advanced NR technique on the raw data would provide better results but I find even the gentlest median filter blotchy and FFMPEG's NLMeans filter only works on 8 bit data so I decided to do this experiment the way I have.

I hope this information is of interest to someone.