Hi folks,

Harry has been very kind to upload one of his images as the subject for a noise reduction tutorial. The file he has uploaded is a remarkably good image of the M81/M82 pair. In Harry's words "this image has a bit of flux in it", and it has been indeed a real pleasure for me to play with it. Take the following as a good example of how easy things can go when there are plenty of well acquired data.

As there are many examples on noise reduction with the ACDNR tool out there, I'll put an example of wavelet-based noise reduction with the ATrousWaveletTransform tool. I'll show you how this tool can be applied to implement an efficient noise reduction procedure in both the linear and nonlinear stages. This is a unique characteristic of ATWT; no other noise reduction tool can be applied to linear images.

So we begin loading the image and applying an automatic STF, as usual. See it below.

An interesting background for sure. The next step is building a mask to protect high SNR areas during noise reduction. Good masking is particularly important with a linear image. The mask is actually as simple as it can be: I have duplicated the image and applied a histogram transform, which is just the automatic STF transferred to the HistogramTransformation tool.

This mask must be activated on the original (linear) image with mask inversion, since we want to protect bright areas.

Here is the ATrousWaveletTransform tool with the noise reduction parameters I have applied. First the image enlarged 2:1 before noise reduction:

Now the same view after noise reduction:

Let's take a closer look. This is before noise reduction, zoomed 6:1:

And the same view after noise reduction:

I would say the result is excellent. The main reason is, beyond the quality of the applied tools, that with abundant data image processing simply works and yields good results in a natural and smooth way. With insufficient signal, one often feels like trying to substantiate a questionable result from marginal data. This is particularly true of noise reduction.

I want to draw your attention to several important facts about the above noise reduction procedure:

- We are working on the linear image. As I said above, wavelet-based noise reduction works with both linear and nonlinear images. This is a nice feature because noise reduction can be much easier to understand and more controllable with linear data, especially with high SNR linear data.

- A simple lightness mask is being used. The mask has been activated with inversion because we want to protect high SNR regions, that is bright pixels. Recall that a mask protects where it is black, and allows full processing where it is white.

- Wavelet-based noise reduction works on a per-layer basis. By applying noise reduction to the first wavelet layer, we can suppress or reduce high-frequency noise. On subsequent layers we can apply noise reduction to larger structures. In this case we have worked on the first four wavelet layers, that is up to the scale of eight pixels.

- Wavelet noise reduction parameters are very easy to understand. This is one of the reasons why wavelet-based noise reduction can be so powerful. We have the following parameters for each layer:

* Threshold. This parameter is expressed in

*sigma units*. Sigma here refers to the standard deviation of the set of wavelet coefficients in a wavelet layer. As you known the

standard deviation is a measurement of

*dispersion* in a data set. Wavelet coefficients have positive and negative values and a mean value of zero in each layer. Coefficients corresponding to significant image structures tend to have larger magnitudes (absolute values), while coefficients corresponding to the noise are smaller and hence closer to the central peak of the distribution. The threshold parameter tells how much of these noisy coefficients will be removed or attenuated. By increasing threshold you can remove more noise, but if you increase threshold too much you'll start removing significant structures.

* Amount. This parameter governs the degree of attenuation applied to noise wavelet coefficients. When amount is one, noise coefficients will be completely removed (well, the actual process is not so simple but you get the idea).

* Iterations. Sometimes noise reduction can be better controlled by applying the same process several times on the same wavelet layer. For example, one can decrease amount and increase iterations as a way to gain more fine control.

Note that a threshold value of 3 sigma means that a 99.7% of the wavelet coefficients will be removed or attenuated. One can only apply such a strong noise reduction to the first wavelet layer, and not in all cases. This is because the first wavelet layer supports most of the high-frequency noise in the image and few significant coefficients, but each image is different. For most deep-sky images, threshold=3 is a good starting point for the first wavelet layer. For subsequent layers, threshold must be reduced drastically to avoid destroying important image features.

Now the image is no nice and seems to respond so well to everything I do, that I can't resist doing a more elaborate example. This is a first nonlinear stretch. As is customary in PixInsight, we have high precision tools so this can be done perfectly in a single step --forget all that ugly multiple stretches so common in other applications. They simply reflect the inability of those applications to handle real image data (they are image retouching toys, not real image processing software).

Now

*this* is a busy background (I read this sentence somewhere and nobody understood him --I did/do). How about a HDR wavelet transform? Here it is.

Easy and effective, doing justice to all the nice data we have. Again,

*this* is real image processing.

Finally, as an option, we can apply a second noise reduction with wavelets. This is the mask, which is a simple duplicate of the image:

And here is the result of wavelet-based noise reduction applied to the nonlinear data:

As I said before, a real pleasure. I hope you find it useful. Thanks Harry and congrats on a very nice image. I do hope you've got good RGB data for this one!