Author Topic: SNR  (Read 6348 times)

Offline GaryP

  • Member
  • *
  • Posts: 72
    • Astroimaging Log
SNR
« on: 2014 August 05 21:55:56 »
I made three different stacks of IC1396 with a DSLR camera, and I want to make sure I'm working on the best stack. One of the stacks is a reregistered integration of the other two. I've been trying to figure out how to use PixInsight to determine SNR. One message from an apparent expert on the PI forum says use AvgDev for the signal and MRSNoise for the noise and then do the division.

I found AveDev in the Statistics readout. Notice there is not a whole lot of difference in the stacks. July 25 has the edge.

Table 1: AveDev from Statistics, 3 Stacks
   R   G   B
Jul 25:   1.21e-03   8.79e-04   6.86e-04
Jul 27:   1.13e-03   8.05e-04   6.37e-04
combi:   1.20e-03   8.65e-04   6.61e-04

MRSNoise is supposed to be in NoiseEvaluation, a script that just runs immediately on an open image and displays its results on the console, but I don't find anything called MRSNoise in it. Here is a readout from the console for the combined stack.

stk3_2_1_2014_07_25_27combined_rl4

Calculating noise standard deviation...

* Channel #0
?R = 9.237e-05, N = 186299 (1.23%), J = 4

* Channel #1
?G = 7.597e-05, N = 397750 (2.62%), J = 4

* Channel #2
?B = 8.241e-05, N = 884136 (5.83%), J = 4

So maybe MRSNoise refers to the sigma values above (?sigma = mean root square). What, exactly, does N refer to? Table 2 gives the sigma values.

Table 2. Sigma values from NoiseEvaluation, three stacks

   R   G   B
Jul 25:   1.305e-04   1.079e-04   1.115e-04
Jul 27:   1.385e-04   1.137e-04   1.180e-04
combi:   9.237e-05   7.597e-05   8.241e-05

Notice the smaller noise values for the combination stack. Now we can do the arithmetic for SNR:

Table 3. Signal to noise ratios (AveDev/Sigma), three stacks

   R   G      B
Jul 25:   9.27203, 8.14643, 6.15247
Jul 27:   8.15884, 7.08004, 5.39831
combi:   12.9912, 11.3861, 8.02087

In my very limited experience, those look like plausible SNR values. We see that Jul 25 beats Jul 27 in every channel in spite of better seeing on the 27th, but the combined stack of 69 subs beats them both by a substantial amount. This is due mainly to dividing similar signal values by lower noise values in the combined stack. It may be the case that some difference in calibration parameter settings had something to due with getting those noise values down, but my records are not good enough to say.

I know little about any of this. I would like to know if what I have presented makes any sense.
« Last Edit: 2014 August 05 22:02:17 by GaryP »
PI 01.08.01.1092 on 4GB iMac w. Mavericks, Canon T1i DSLR, William Optics 110mm APO FL770, WO focal reducer (at 73.5 mm), CGEM

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: SNR
« Reply #1 on: 2014 August 05 22:21:40 »
The N number in the script output is the number of pixels in the image used to measure noise. J is the number of multiscale levels used to distinguish these pixels.

IMO, AvgDev / MRSNoise, as you are calculating, is usually a good measure of image quality, a good way to characterize SNR, but it is not the SNR of anything in the image of course. It is a "scale" to noise ratio, where scale is image dispersion, a measure of the typical distance between any pair of pixels in the image. AvgDev is one of several ways to measure scale, others are preferred sometimes for more robustness (see the list in ImageIntegration).

Mike

Offline GaryP

  • Member
  • *
  • Posts: 72
    • Astroimaging Log
Re: SNR
« Reply #2 on: 2014 August 05 23:29:57 »
Mike, Thanks, It's good to know that the procedures made some sense, but please bear in mind that you are dealing with someone who knows next to nothing about the theory of image processing.

>The N number in the script output is the number of pixels in the image used to measure noise.

Why does this number vary? Or if it is the same as the number of pixels containing noise, how are those pixels identified?

>J is the number of multiscale levels used to distinguish these pixels.

I don't understand what this means, but it appears to have some bearing on my previous questions. What is a "multiscale level"?

>IMO, AvgDev / MRSNoise, as you are calculating, is usually a good measure of image quality, a good way to characterize SNR, but it is not the SNR of anything in the image of course. It is a "scale" to noise ratio, where scale is image dispersion, a measure of the typical distance between any pair of pixels in the image. AvgDev is one of several ways to measure scale, others are preferred sometimes for more robustness (see the list in ImageIntegration).

Does this mean there is no good way to measure "signal"? Or is this really a better way of characterizing image quality than a more direct SNR measure?

Gary
PI 01.08.01.1092 on 4GB iMac w. Mavericks, Canon T1i DSLR, William Optics 110mm APO FL770, WO focal reducer (at 73.5 mm), CGEM

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: SNR
« Reply #3 on: 2014 August 06 06:24:22 »
>The N number in the script output is the number of pixels in the image used to measure noise.

Why does this number vary? Or if it is the same as the number of pixels containing noise, how are those pixels identified?

>J is the number of multiscale levels used to distinguish these pixels.

I don't understand what this means, but it appears to have some bearing on my previous questions. What is a "multiscale level"?

MRSNoise estimates noise by measuring pixel variance in smooth patches of the image. Smooth patches are identified by wavelet techniques. The number of wavelet levels employed and the number of pixels deemed smooth vary with the image.

>IMO, AvgDev / MRSNoise, as you are calculating, is usually a good measure of image quality, a good way to characterize SNR, but it is not the SNR of anything in the image of course. It is a "scale" to noise ratio, where scale is image dispersion, a measure of the typical distance between any pair of pixels in the image. AvgDev is one of several ways to measure scale, others are preferred sometimes for more robustness (see the list in ImageIntegration).

Does this mean there is no good way to measure "signal"? Or is this really a better way of characterizing image quality than a more direct SNR measure?

Signal and noise can be estimated, but additional information and advanced techniques are required. Consider an image with a strong gradient. SNR will be relatively lower in areas where the gradient is brighter. Measuring SNR requires characterizing the gradient, and many other things.

Scale to noise ratios are useful and much easier to calculate. Lower noise cameras, darker skies, more transparent skies, and more exposure time all result in higher scale to noise ratios. But other factors are also important to image quality, eg, seeing, tracking, and focus.

Mike
« Last Edit: 2014 August 06 07:20:47 by mschuster »

Offline GaryP

  • Member
  • *
  • Posts: 72
    • Astroimaging Log
Re: SNR
« Reply #4 on: 2014 August 06 08:17:49 »
That helps. No further questions. It would be nice if someone would use a forum thread to provide an online primer on wavelets, which are used in several important scripts and functions. That might help many users to make more intelligent use of PixInsight. "Wavelets for Image Processing".
PI 01.08.01.1092 on 4GB iMac w. Mavericks, Canon T1i DSLR, William Optics 110mm APO FL770, WO focal reducer (at 73.5 mm), CGEM

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: SNR
« Reply #5 on: 2014 August 06 13:21:15 »
Gary,

There is a great discussion of the theory and practice of wavelets in the Handbook of Astronomical Image Processing by Richard Berry and James Burnell.  The 2nd edition was put out in 2005 so its a bit dated but its still the best tome on the concepts so often employed in PI that its well worth a look.  You won't be disappointed.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline GaryP

  • Member
  • *
  • Posts: 72
    • Astroimaging Log
Re: SNR
« Reply #6 on: 2014 August 06 14:41:30 »
Good to know. Used copies are available at about $80.
PI 01.08.01.1092 on 4GB iMac w. Mavericks, Canon T1i DSLR, William Optics 110mm APO FL770, WO focal reducer (at 73.5 mm), CGEM

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: SNR
« Reply #7 on: 2014 August 06 19:35:15 »
You can also buy it new from WillBell.com.

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: SNR
« Reply #8 on: 2014 August 07 09:25:43 »
Suppose you blur an original image. At every pixel the result gives the average intensity within the blurring radius.

Now subtract the blur from the original to form a detail image. At every pixel the result gives the difference between the pixel and the average intensity around the pixel. This detail will be near zero if the pixel intensity happens to equal the average intensity, in other words, the pixel is smooth relative to all pixels within the blurring radius. This detail image forms a level one wavelet layer.

Now do the same process over again with a larger blurring radius. You get a second detail image with information at a larger size or scale. This is level two. And so on with larger and larger radii.

Basically this is an example of a wavelet transformation. It provides image information at different scales and allows you to query or manipulate features at different scales independently, such as testing for the presence of, suppressing, or strengthening some particular feature.

This is an oversimplification.

Mike

Offline GaryP

  • Member
  • *
  • Posts: 72
    • Astroimaging Log
Re: SNR
« Reply #9 on: 2014 August 07 10:23:49 »
Mike, you needn't worry about oversimplification in my case. It's nice to be guided around among the pixels at level 1. It will certainly do until my copy of Berry and Burnell arrives.
PI 01.08.01.1092 on 4GB iMac w. Mavericks, Canon T1i DSLR, William Optics 110mm APO FL770, WO focal reducer (at 73.5 mm), CGEM