Author Topic: TGVDenoise Example: Noise Reduction in CIE Lab Mode  (Read 20754 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi all,

As promised, here is a first noise reduction example with the new TGVDenoise tool. To show a complete workflow with color data, I have chosen an image that poses a relatively difficult problem for noise reduction. It is a Canon EOS 7D raw image that has already been stretched and saturated with the HistogramTransformation and CurvesTransformation tools in PixInsight.

A strong color saturation curve has been applied directly after the initial stretch, which has been an obvious mistake: A side effect of this uncontrolled color saturation boost is generation of severe noise in the chrominance. We know that color saturation enhancements must be applied with some control (with protection masks, and/or after noise reduction, etc.), in order to prevent chrominance noise intensification. But this is just an example, where I have taken the liberty to make some things difficult on purpose.


The resulting image is an interesting noise reduction problem, mainly due to the following factors:

(1) Severe chrominance noise, for the reasons explained above.

(2) Fine details at scales dominated by the noise.

(3) Low-contrast structures that can be problematic for edge protection.

(4) Extended background areas with strong noise and no significant detail.

Reason (1) is why we have implemented a special CIE Lab working mode in the TGVDenoise tool. When the noise is very different (in its distribution and intensity) for the lightness and chroma components, applying two separate noise reductions seems the most logical option. Reasons (2) and (3), and the fact that they are plainly opposite to (4), suggest the need for a local support image to drive the TGV regularization algorithm.

As usual, we'll work on a small preview covering a region of special interest. Recall that as long as we don't enable its automatic convergence parameter, TGVDenoise is a fully previewable process, so what we'll get on the preview will be consistent with the result obtained on the whole image.


The screenshot above will give you an idea of the severity of the noise in our working image, especially color noise.

Our first step is building a local support image. By default, the TGVDenoise tool uses the intensity component (in the HSI system) of the target image. In this case, however, I prefer to work with the lightness component because it is much less noisy than intensity, due to the color noise problems that I have described. So we'll extract lightness (IMAGE > Extract > Lightness) as a new image and select it as a local support on the TGVDenoise tool.


Recall that a local support is intended to represent the signal-to-noise ratio of the target image, with the purpose of conditioning the TGV noise reduction algorithm. So where the local support image is white we are saying 'this is signal, look but don't touch!', and where the support is black we say 'this is trash, remove it please'. To improve the support in this sense, we have several histogram controls. I have used the midtones balance and shadows clipping parameters to increase contrast, as shown in the next screenshot:


I have also removed the first wavelet layer to make the support slightly less noisy, and hence more accurate. Note that this does not alter the support image in any way; the transformations are applied to an internal working duplicate, never to the selected image.

On the screenshot above, note that I have selected the Preview mode in the Local Support section. In this mode, TGVDenoise replaces the target image with a copy of its internal working support image, which is useful to control the support. We have to disable this mode to perform an actual noise reduction procedure.

As I have said at the beginning of this post, we'll work in the CIE Lab color mode of TGVDenoise in this example. We'll start with lightness noise reduction, so we'll disable chrominance parameters and select the Lightness display mode for the target image. In this way we can concentrate on the lightness, without wasting time processing the chrominance components. This allows us to save a 67% of processing time during our initial testing steps.


After some trial-error work, this is my processed lightness:


Let's repeat the same procedure for the chrominance. Disable lightness parameters and select the "a=R b=G" display mode:


In this mode, the red and green channels show a representation of the CIE a* and CIE b* chrominance components, respectively. This allows you to visualize the color components of the image independently from lightness, that is, what you see on the screen is a special rendition of pure color contents. This mode is especially handy for noise reduction, as you can see in these screenshots. Below is my final processed chrominance.


Note that the chrominance parameters are much more aggressive than the lightness parameters. As you know, the human vision system is rather poor at detecting details defined by color variations. Most of the detail we perceive in an image comes from lightness variations. Thanks to this property of our vision, we usually can apply a comparatively strong noise reduction to the chrominance without damaging the perceived detail. In this example, I have used an edge protection parameter value that is about one order of magnitude larger for chrominance than for lightness.

This is my final denoised image:


For better evaluation of the result, let's take a closer look at some regions of particular interest. Below are three crops of 200x200 pixels enlarged 3:1 without interpolation; original versus processed image.




The result is very good in my opinion, especially considering the severity of the noise in the original image. It is not perfect, of course, and we can easily find positive and negative aspects. For example, some low-contrast structures have been damaged in the green stem of the third crop, and we can find a number of small details that have lost some of their initial color support. On the other hand, low-contrast features have been preserved remarkably well on the shadowed yellow areas of the second crop, and the spider webs have been protected extremely well over a smooth background on the first crop. Overall, this kind of result is very difficult to achieve, if not impossible, with other noise reduction tools that we have implemented in PixInsight. More examples to come.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #1 on: 2013 May 14 11:11:30 »
Impressive! Will you include this in the built-in documentation? It would be nice to have this available off-line without having to search for it.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #2 on: 2013 May 14 11:15:34 »
Hi Sander,

Thanks! Yes, we'll gather all the material we are posting here to write an official documentation for TGVDenoise.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #3 on: 2013 May 14 11:20:50 »
Super.  :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Lex

  • PixInsight Guru
  • ****
  • Posts: 555
  • We do it at night...
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #4 on: 2013 May 14 12:16:54 »
Hi Juan,

really impressive; this is just what I was looking for for a long time. You have managed to create an absolute professional wonder weapon; placing all of the other Plugins like noise ninja for example in the darkness; forget about them  O0
A big thank you to the whole PI team for this stunning part!

Just a stupid question; the tool wasn't especially created for DSLR data; it will work by the same manner on mono or OSC CCD data?

Best and keep on stunning me (us)  >:D

Lex
Clear Skies!!

Lex

______________________________________

AZEQ6 GT, TS UNC 10" f5, ASI1600mm-c

HADSO (Hagen Deep Sky Observatory)20 km W of Luxemburg City

Offline gvanhau

  • PixInsight Old Hand
  • ****
  • Posts: 345
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #5 on: 2013 May 14 13:01:58 »
Hello Juan
Very impresive.

About the example, in order to get the final result,  did you first apply tgv on ligness and afterwards on crominance or did you apply it all together at the final step?

I did a little test on the tool last night, and got some ringing on stars (dark halos) (had not more time to continue experimenting) does this ringing have to be minimized trough edge protection parameter? or by adecuating local support image?

Regards
Geert
« Last Edit: 2013 May 14 13:10:22 by gvanhau »
Geert Vanhauwaert

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #6 on: 2013 May 14 13:22:57 »
Hi Lex,

Thank you!

Quote
it will work by the same manner on mono or OSC CCD data?

TGVDenoise works with any kind of images, including linear and nonlinear (stretched) images, color and grayscale images.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #7 on: 2013 May 14 13:28:21 »
Thank you Geert,

Quote
in order to get the final result,  did you first apply tgv on ligness and afterwards on crominance or did you apply it all together at the final step?

In the final step I have enabled both lightness and chrominance parameters. You could also apply first to lightness only, then to chrominance only. This can be useful, for example, to use a different support image at each stage.

Quote
I did a little test on the tool last night, and got some ringing on stars

That should never happen under normal conditions. If you upload the image in question, I'd be glad to try out TGVDenoise on it. Keep in mind that we are still learning to use this tool!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #8 on: 2013 May 14 13:41:01 »
i saw ringing like that when trying to work on a linear image (m63). for fun i stretched it and it seemed to be a lot easier to hone in on the right parameters.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #9 on: 2013 May 14 14:46:09 »
The ringing may be generated by an insufficient number of iterations. First try a huge number of iterations on small previews (lets say, 500). Then, use the convergence criteria on larger images to stop when no visible change is achieved.

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline resonance

  • Newcomer
  • Posts: 13
    • Stelleelettroniche
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #10 on: 2013 May 15 02:34:09 »
Oh no...now I will have to learn another fantastic tool :P

Thank you for the development!

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #11 on: 2013 May 15 03:35:59 »
Hi

I tried some testing on b/w linear astronomy images and it is hard to find the good parameters (even the local support). Need many try
In this case, many parameter are very low in the range 10-5 / 10-6. A few variation on parameters can change the result in bad or good !
But, at the end, the result can be very good  ;)

It is the most powerful noise reduction function BUT need practice and many tries. Also to be careful to not remove all the noise (it is not nice) 
For sure, examples like you provided, Juan, is very useful to understand. Now I learn and see the "local support" importance !

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #12 on: 2013 May 15 03:45:20 »
Hi Philippe,

Thanks. Yes, this tool requires a lot of practice. Well, actually not more than any complex tool. Once you get some practice you start 'feeling' the parameters and it becomes easier each time you process a new image.

What we need now is more data to test the tool. If you can upload an image, I'll be glad to make an example and post it here.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline wnourse

  • Newcomer
  • Posts: 10
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #13 on: 2013 May 15 04:35:51 »
I tried this out last night on a very noisy image-in-progress and saw significant improvement with the just the default parameters.  This looks to be a very powerful tool and I'm looking forward to working with it some more.

Thanks for all the work!

Will

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: TGVDenoise Example: Noise Reduction in CIE Lab Mode
« Reply #14 on: 2013 May 15 04:47:14 »
Nice module. The default parameters work well for stretched images. Linear images (based on a sample of 1) seem to need more tweaking.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/