What is the source file for noise reduction?

Then I can probably get away with removing it, which is beneficial because I don’t exactly understand the way it’s feathering. It looks like it blends the tiles in RGB space, whereas I want to leave the output in Lab.

Iirc the feathering is ony for luminance noise…

@CarVac Concerning the tiling: the code first tries to allocate memory for a not tiled processing. Only if that fails, it falls back to a processing of 9 tiles to reduce memory usage.

Okay, now I’ve got it running, but I can’t seem to get quite the same results. When I look at the pp3, the chroma, Redchro, and Bluechro values are not the same as the ones in the UI, but redchro and bluechro seem to depend on the raw file? Maybe this depends on white balance?

For me, I’m giving it 0 redchro and bluchro, and the chroma ranging from 0.3 to 1. It doesn’t seem to do anything at all below 0.31, but above that it immediately becomes very strong.

What sort of range of Lab values goes in to the function in RawTherapee? I’m feeding it stuff from roughly -1 to 1…

Additionally, merging the L channel from nlmeans and the ab channels from directional pyramid is not yielding the result I expect. That may take some tweaking, though.

One issue solved… by multiplying the lab values by 100 prior to noise reduction, a range of 0-100 for chroma works nicely, and it doesn’t have the same smearing as before.

The L/ab channel merge still isn’t cooperating though, but I’m hoping that’s solved by impulse noise reduction.

1 Like

Another update:

I figured out that instead of merging the L channel of nlmeans and the AB channel of the directional pyramid denoising, I can run directional pyramid denoising on the nlmeans output.

It’s pretty good, but it has some weird artifacts that remind me of a color-inverted blue-ringed octopus

Screenshot_20210614_210721

The better parts actually look quite fine, though, and it is in my opinion quite outstanding on images that are not as noisy (this is ISO 25600 on an a7r4).

Looks like some discontinuity in the blending. I get this sometimes in my experiments.

It’s not blended right now, it’s applied sequentially.

My next attept will be swapping the order—perform directional pyramid denoising, then convert back to RGB and do nonlocal means, then go back to lab for impulse noise reduction.

What images are you using for your tests?

I’ve been using the DPR test scene shots from the D5 at 12800 with the incandescent illumination and the A7R4 at 12800 and 25600 with daylight illumination, and two of my own 60D shots (incandescent illumination, iso 6400 and 12800).

Do you have any advice on how to avoid it?

In hindsight, I do think it is essentially blending, since the chroma noise reduction only touches the chroma.

Noise reduction isn’t my forte: I can only tell you the symptoms. I don’t know how much of it is JPEG compression but this is what I get from two basic conversions:

srgb2rgb rgb2lch

L*C*h° left to right

As you can see, the noise type and patterns for each channel after noise reduction are noticeably different and unrelated, which makes the filtered image problematic and means that your methods or parameters are unsuitable for this sample.

1 Like

I tried it on this image taken from a playraw and it did a nice job esp on the yellow flowers but took forever and ever on my older machine. I have 32GB but that may not be enough …also when I turned NR off and then back on to see the effects it crashes and closes the program…maybe I am running out of memory…but I suspect this is a use case Ie checking with NR on and off so maybe caching in some way the last set of NR settings so that it doesn’t have to run all over again might be a nice addition…
IMG_3868.CR2 (27.7 MB)

My laptop’s 4GB (used to be 2GB) cries in the darkness. It is crazy that so much RAM is still inadequate.

Are you on Windows?

32 gigs should easily be enough, even with other things running. I’ve only run into memory pressure on 50+ megapixel images. With that file open, I’m seeing about 7.5 gigabytes used. I think I can reduce this, though, by clearing away later, invalidated computation results early on in the pipeline.

The noise reduction switch can’t exactly cache the changes because the switch itself turns on or off a different demosaic method.

I need to stress-test it more to see what might be causing crashes.

1 Like

Bear in mind that nlmeans is looking for similar patches. It might help to apply some noise reduction prior to nlmeans to help to identify similar patches.

I am not familiar with your implementation, but I would suggest doing impulse noise reduction prior to nlmeans. Strong impulse noise may reduce patch similarity when comparing patches.

In my GMIC noise reduction experiments, I often use a slightly blurred version of the image as a guide image. This reduces the impact of impulse noise. Patch weights are calculated on this image and then applied to the original image.

Likewise, doing some chroma noise reduction prior to nlmeans may help with patch finding. In my GMIC experiments, using a desaturated image as a guide gives improved chroma noise reduction in nlmeans, but chroma edges where the luminance is the same are destroyed.

I already tried putting chroma NR before nlmeans, thinking along the same lines, but it turned out horribly.

Ya I will try again too…maybe it was a one off

I ran into this as well. I guess one has to prioritize and compromise.

Well, I just found that I was leaking memory to a horrible extent.

With that fix and another change to reduce peak memory usage, the A7r4 only uses about 11 gigs peak, which I consider reasonable for an outrageously high res camera.

New builds should be coming soon…

1 Like