Author Topic: New Noise Reduction Technique?  (Read 7487 times)

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
New Noise Reduction Technique?
« on: 2019 December 31 14:55:46 »
Hi All -

Because of my light pollution and limited imaging time I always have plenty of noise in my stacked images. Recently I have been successfully using a new technique to reduce the noise in the stacked image. It may be a known technique, but, I haven't seen it before.

The link below takes you to a tutorial showing how to use the technique. I've found that it takes about 2 to 3 minutes to perform the noise reduction.

https://theskysearchers.com/viewtopic.php?f=22&t=5799

After viewing the tutorial the following may help to explain how the noise reduction is achieved. The technique reduces the noise by averaging each pixel with it's four nearest neighbors (one at a time) and then averaging those four averages. It reduces noise by almost a factor of 2 while retaining all the pixels (no binning). It does slightly blur the image (very slightly) which is the tradeoff to reduce the noise (no free lunch as they say).

The equation below shows the four individual averages, and, then their average to produce the desired result. It is the averaging of noise from adjacent pixels (not the blurring) that leads to the noise reduction.

[(orig + R)/2 + (orig + L)/2 + (orig + U)/2 + (orig + D)/2] / 4 = Average

Comments welcomed.

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: New Noise Reduction Technique?
« Reply #1 on: 2019 December 31 17:01:13 »
i think you can accomplish this in one fell swoop with pixelmath:

(((pixel($T,x()+1,y())+$T)/2)+
((pixel($T,x()-1,y())+$T)/2)+
((pixel($T,x(),y()+1)+$T)/2)+
((pixel($T,x(),y()-1)+$T)/2))/4

rob

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
Re: New Noise Reduction Technique?
« Reply #2 on: 2019 December 31 17:41:51 »
i think you can accomplish this in one fell swoop with pixelmath:

(((pixel($T,x()+1,y())+$T)/2)+
((pixel($T,x()-1,y())+$T)/2)+
((pixel($T,x(),y()+1)+$T)/2)+
((pixel($T,x(),y()-1)+$T)/2))/4

rob


Thanks so much rob. I've already edited my icon set to include this improvement. Definitely makes the process easier to implement. Now only one clone (I create a clone named Average) is required.

Cheers,

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
Re: New Noise Reduction Technique?
« Reply #3 on: 2020 January 01 19:24:00 »
Just a little clarification about this technique.

This technique has benefits similar to the benefits of binning, but, binning isn't used. As mentioned previously, the noise is reduced by about a factor of two, also, the reduced image is the same size as the original, and, the stars remain round with no "blocky" stars like binning can produce. To achieve this same level of noise reduction by just gathering more data would require me to gather almost 4 times as much data. So, this noise reduction is a really big deal for me.

With Rob's nice improvement I simply create one clone of the target image and drag a PI icon (with all the shifting and adding and averaging included) onto the clone to do the noise reduction. The entire noise reduction takes only about 1 minute. Thanks again Rob!

Hope this proves useful for some of you.

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: New Noise Reduction Technique?
« Reply #4 on: 2020 January 01 21:54:51 »
if i remember right something like this was discussed on CN, though i think they were talking about creating shifted versions of each subexposure and then integrating them together. i did try that and saw some improvements but i ended up with the smaller stars getting a little blocky.

this is a lot less work since you only need to do it to the master frame...

rob

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: New Noise Reduction Technique?
« Reply #5 on: 2020 January 02 02:42:46 »
If I have understood correctly, I think this technique would be a convolution using this 3x3 matrix:
Code: [Select]
0 1 0
1 4 1
0 1 0
In this case it would be a really old and well known method for noise reduction.

Offline dld

  • PixInsight Addict
  • ***
  • Posts: 132
Re: New Noise Reduction Technique?
« Reply #6 on: 2020 January 02 04:01:48 »
That's true. It is a blur filter. It can also be implemented as a Convolution filter:

Code: [Select]
KernelFilter {
   name { Blur (3) }
   coefficients {
       0.000000   1.000000   0.000000
       1.000000   4.000000   1.000000
       0.000000   1.000000   0.000000
   }
}

This is faster, probably because the Convolution process uses FFT. Rob's PixelMath expression is equivalent, modulo edge (boundary) effects.
« Last Edit: 2020 January 02 05:39:53 by dld »

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
Re: New Noise Reduction Technique?
« Reply #7 on: 2020 January 02 08:49:01 »
If I have understood correctly, I think this technique would be a convolution using this 3x3 matrix:
Code: [Select]
0 1 0
1 4 1
0 1 0
In this case it would be a really old and well known method for noise reduction.

Thanks Andres - I'm getting pretty old, so, only makes sense I would "invent" something that is really old and well known.

However, this "filter" helps my data very much with minimal "blurring". No masks, and, it doesn't make the background look "plastic".

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
Re: New Noise Reduction Technique?
« Reply #8 on: 2020 January 02 08:53:11 »
That's true. It is a blur filter. It can also be implemented as a Convolution filter:

Code: [Select]
KernelFilter {
   name { Blur (3) }
   coefficients {
       0.000000   1.000000   0.000000
       1.000000   4.000000   1.000000
       0.000000   1.000000   0.000000
   }
}

This is faster, probably because the Convolution process uses FFT. Rob's PixelMath expression is equivalent, modulo edge (boundary) effects.

Thanks "did" - I tried running it as a Convolution process using your code and it worked perfectly. Unfortunately, I couldn't figure out how to save the filter for future use. Oh well, I have Rob's approach already saved in icon form.

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/

Offline dld

  • PixInsight Addict
  • ***
  • Posts: 132
Re: New Noise Reduction Technique?
« Reply #9 on: 2020 January 02 09:12:20 »
You are welcome, Steve,

The Convolution process can be saved as an icon like all processes by dragging the "triangle" of the process window. If you are getting the warning that "the current filter library is not writable", just save the filter library in a different .filter file in a convenient place, and not where PI is installed.

Offline STEVE333

  • PixInsight Addict
  • ***
  • Posts: 231
    • sk-images
Re: New Noise Reduction Technique?
« Reply #10 on: 2020 January 02 09:47:03 »
You are welcome, Steve,

The Convolution process can be saved as an icon like all processes by dragging the "triangle" of the process window. If you are getting the warning that "the current filter library is not writable", just save the filter library in a different .filter file in a convenient place, and not where PI is installed.

Thanks for the help. My first time into the world of Convolution!

Steve
Telescopes:  WO Star71 ii, ES ED102 CF
Camera:  Canon T3 (modified)
Filters:  IDAS LPS-D1, Triad Tri-Band, STC Duo-Narrowband
Mount:  CEM40 EC
Software:  BYEOS, PHD2, PixInsight

http://www.SteveKing.Pictures/