Author Topic: S/N estimate  (Read 5962 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
S/N estimate
« on: 2009 November 01 03:49:57 »
As far as I can see, there is no process that estimates signal/noise ratio in images. There is a utility script that does noise estimates, and image integration also uses S/N ratios. Maybe the estimates could be added to the Statistics process.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: S/N estimate
« Reply #1 on: 2009 November 01 14:39:59 »
The noise estimation script?

Max

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: S/N estimate
« Reply #2 on: 2009 November 01 14:56:45 »
Estimates noise, but not S/N.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: S/N estimate
« Reply #3 on: 2009 November 02 02:19:51 »
Hi Georg,

Noise is uncertainty in the data. For this reason, the signal-to-noise ratio cannot be evaluated in a single image, unless you have an a priori, perfect knowledge of the signal. Perfect means here with no uncertainty. Such an a priori knowledge would only be possible if you could control the whole image generation process, as in synthetic image renditions for example. Of course, that never happens with real-world images, and very especially it doesn't happen with astronomical images —or noise reduction would consist of a simple subtraction, and deconvolution would always work as an ideal process!

The stochastic nature of the noise allows us to guess a noise estimate, based on statistical properties, assuming a particular probability density function of the noise in the image, or noise distribution. Usually, the Gaussian distribution is used to this purpose; sometimes also the Poisson distribution because it can be used to model photon counting processes. PixInsight computes noise estimates using high-accuracy multiscale, wavelet-based algorithms.

So in real-world images, signal-to-noise measurements are always relative, never absolute. For example, we can estimate how the SNR improves after a given process, by measuring the importance (in statistical terms) of the noise before and after the process. Of course, this only works if we know that either the signal remains constant during the process, or we can predict how the signal changes during the process. PixInsight does this as part of its standard ImageIntegration tool, in order to provide an estimate of the quality of the integration procedure.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: S/N estimate
« Reply #4 on: 2009 November 02 03:27:01 »
Juan,

Thanks for the answer. The reason why I would like to have an S/N estimate:
- I get two stacked+normalized images from DeepSkyStacker, stacked with different DSS settings.
- Both look good, but I feel one is better.
- I would like to have some concrete indicator on which image is "better" for the following processing in PI. Of course, I can use my gut feelings, but trying to use some objective number, such as S/N ratio, would be better.

Did I understand correctly that it is just impossible to get a S/N estimate for a single picture? Or how could I do it? I guess, the difficult part now is to identify what in the picture is "signal". Would it be incorrect to assume that anything that is not noise as estimated by the noise script is signal? I suppose this is a stupid question, but statistics are just not my field of expertise.

Georg
 
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: S/N estimate
« Reply #5 on: 2009 November 02 07:54:17 »
Quote
Did I understand correctly that it is just impossible to get a S/N estimate for a single picture?

Correct. We cannot estimate the SNR directly because the noise introduces uncertainty in the data.

However, you can easily estimate the relative SNR improvement between your images:

Quote
- I get two stacked+normalized images from DeepSkyStacker, stacked with different DSS settings.
- Both look good, but I feel one is better.
- I would like to have some concrete indicator on which image is "better" for the following processing in PI. Of course, I can use my gut feelings, but trying to use some objective number, such as S/N ratio, would be better.

When you integrate (combine) a set of images of the same subject (the same region of the sky in this case), the signal remains unmodified and the noise tends to cancel out. Note that this is true, irrespective of the number of integrated images. So we can say that the signal is the same in the two images that you have stacked with DeepSkyStacker. As a result of this property, you can ignore the signal and use noise estimates directly to derive a SNR improvement.

However, before performing a numeric comparison between both images, we must ensure that noise estimates are statistically compatible. To this purpose, one of the images (or correspondingly, its noise estimate) must be scaled. There are several ways to scale images, but I personally prefer the average deviation as a robust estimator of dispersion.

The following JavaScript sentences (executed with the new js command) can give you an excellent estimate of the relative SNR improvement of image B with respect to image A:

js nA = <noise-estimate-for-image-A>;
js nB = <noise-estimate-for-image-B>;
js dA = ImageWindow.windowById( "A" ).mainView.image.avgDev();
js dB = ImageWindow.windowById( "B" ).mainView.image.avgDev();
js nA/(nB * dA/dB);

where nA and nB must be assigned with the noise estimates provided by the NoiseEvaluation script, and your images must have identifiers "A" and "B" respectively (change the expressions otherwise).

Let me know how it works.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: S/N estimate (slightly Off Topic)
« Reply #6 on: 2009 November 03 00:03:35 »
Juan,

What an innovative use of the Console - even though you had described this new functionality, this simple exercise makes it so much clearer. Intriguing indeed.

Thanks,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: S/N estimate
« Reply #7 on: 2009 November 03 00:13:25 »
Hi Niall,

Thanks. You know, PixInsight is all about new ways. That's the fun of it.

Now that I see what I wrote yesterday, I must put here a more correct version:

Code: [Select]
js var nA = <noise-estimate-for-image-A>;
js var nB = <noise-estimate-for-image-B>;
js var dA = ImageWindow.windowById( "A" ).mainView.image.avgDev();
js var dB = ImageWindow.windowById( "B" ).mainView.image.avgDev();
js nA/(nB * dA/dB);

or perhaps better:

Code: [Select]
js var nA, nB, dA, dB;
js nA = <noise-estimate-for-image-A>;
js nB = <noise-estimate-for-image-B>;
js dA = ImageWindow.windowById( "A" ).mainView.image.avgDev();
js dB = ImageWindow.windowById( "B" ).mainView.image.avgDev();
js nA/(nB * dA/dB);
Juan Conejero
PixInsight Development Team
http://pixinsight.com/