Author Topic: ImageCalibration Dark Optimization: How does this minimize noise?  (Read 30112 times)

Offline chris_todd

  • PixInsight Enthusiast
  • **
  • Posts: 89
    • I don't have hobbies, I have obsessions...
Keeping terminology discussions aside for a while, here is a detailed description of our dark frame optimization algorithm.

I wish there was a way to "bookmark" certain threads or posts in this forum, because this one is a keeper.  Thanks, Juan!  Now I finally understand how PI does dark scaling.
Uncooled, unmodified Canon T2i/550D, various lenses, and AstroTrac TT320X-AG
I don't have hobbies, I have obsessions...

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
...I = I0 + k*D + B...
In a future version of the dark optimization algorithm we'll compute different optimization factors for separate intensity ranges in a spline fashion. This should fix the hot pixel undercorrection problem.

Juan, thanks for this detailed discussion of the dark optimization method used by ImageCalibration.

- I have the impression that this method is closely related to "Entropy-Based Dark Frame Subtraction", Goesele at. al., 2001. There they optimize the factor k by estimating the entropy (basically the image noise) using image compression algorithms. The main difference to your method seems to be that you use a more direct estimate of noise. In fact, some measure of noise in the result is an element of all dark optimization methods I have seen so far.
- I also came across .pdf]"Denoising photographs using dark frames optimized by quadratic programming", Gemez-Rodgriguez et al,  2009. They minimize the gradients (=noise) to the 8 neighbors of a pixel by scaling darks. They add the ability to determine scaling for a large number of darks taken under different circumstances using  a feature(=dark) selection method frequently used in machine learning. They claim this automatically selects the best darks for the purpose. I am a bit critical of this method since the weighting procedure lacks a relationship to the physics of darks - it is just a data mining approach. Given enough different darks you should be able to remove any noise from any image, and while you are at it also the desired information...  :-[
- A fairly interesting approach is "Removing noise from astronomical images using pixel-specific noise model", Burger et al, 2011 (Video). They assume that the scaling already happened, but then use a more intelligent metric for correcting the pixels that takes into account the observed variabilty of individual pixels in the darks. In my opion, this makes perfectly sense, since I observed pixels with fairly different (random) noise behaviour in my experiments, see previous posts. It probably could be implemented as a second stage (after scaling) into your current ImageCalibration process. We would however need the capability in ImageIntegration to create a variance image along with an average image when integrating the darks.
- In your post you mentioned that you would like to improve ImageCalibration by adding spline based scaling. I am not sure how much benefit this will bring - I observed pixels that are so different to each other. For illustration, I am attaching the curves for 4 pixels of my sensor, showing that pixels can be noisy, go down (!) with exposure time, stay neutral, or go up.
- My current idea is that it would make sense to go even one step further for dark optimization- creating an individual dark response model for each pixel, and use this to scale the darks. I currently have no idea if this can be implemented efficently, and dont have experimental results. But maybe this is an idea you can play with.

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

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 988
    • http://www.astrofoto.es/
- My current idea is that it would make sense to go even one step further for dark optimization- creating an individual dark response model for each pixel, and use this to scale the darks. I currently have no idea if this can be implemented efficently, and dont have experimental results. But maybe this is an idea you can play with.

Hi Georg,

We're talking about two different things:

- Having a master dark frame, subtract the thermal pattern from a target image.

- Having a set of dark frames, make an analysis of dark current behavior for each pixel and then subtract the thermal pattern from a target image.

The work you propose has sense when you have a set of darks with different temperatures and exposure times. The only thing we can do when we have one master dark frame is to simply minimize the effect of the thermal pattern in the target image by subtracting it. Of course, we could do the analysis you propose, but this is a completely different approach.


Regards,
Vicent.

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 988
    • http://www.astrofoto.es/
Hi Vicent. Specifically, during image integration, following MRS evaluation, scaling values are consistently >1, approx 1.003. Usually scaling values after MRS are <1, if the frames have been dark calibrated.

I'm not sure of what these values mean in terms of dark calibration.

How big are those differences? Think that any operation with noise has a level of error... In the integration process we're simply trying to minimize the resulting noise. You may expect a weight change because the noise in the images changes if you don't subtract the master dark frame.


Regards,
Vicent.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
...We're talking about two different things:...
Vicent,

you are right. I am proposing to scale darks (or more exactly: estimate a reasonable values for dark subtraction) based on the information available in darks obtained from different exposure times, not just one master dark (plus bias-which in essence is a dark with exposure 0). Based on the experiments I made this would make perfect sense because (at least for my DSLR, dont know if this is valid for other DSLRs or professional CCDs) it appears that pixels behave too differently to just scale all pixels by the same factor k.

Georg
« Last Edit: 2012 April 25 03:59:11 by georg.viehoever »
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

astropixel

  • Guest
Thanks Vicent. Very small differences, which made me think that I could use fewer dark frames. So, I took 10 temperature regulated darks (11C) to make a master dark. There was little difference in appearance between the dark calibrated integrated image and the no dark calibrated image in STF.

Optimize was not selected during image calibration. I think more darks are required to use optimization. I'll try 15. The idea is to find the minimum number of darks required for a cooled DSLR.
Quote
it appears that pixels behave too differently to just scale all pixels by the same factor k.

This is probably true for consumer DSLR's.
« Last Edit: 2012 April 25 04:04:53 by astropixel »

ruediger

  • Guest
The idea is to find the minimum number of darks required for a cooled DSLR.
Don't forget, that the dark frames also contain readout noise. If your master dark is made of only 10 or 15 frames, you will unnecessarily add noise to each single light and partly loose your advantages from cooling.

Could you please give the new CCD parameters script a try forum/index.php?topic=4086.msg29090#msg29090 and post the results in this thread?. You have to supply two flats, two bias and two darks with different exposure times. I would like to see some characteristics of a cooled DSLR.

Rüdiger

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 988
    • http://www.astrofoto.es/
This is something we need. It would be good if we have a set of tools that, provided the specific set of images, analyze your camera. Not only darks, but also bias vs. temperature, or linearity tests, amog many other possible tests.

V.

 

...We're talking about two different things:...
Vicent,

you are right. I am proposing to scale darks (or more exactly: estimate a reasonable values for dark subtraction) based on the information available in darks obtained from different exposure times, not just one master dark (plus bias-which in essence is a dark with exposure 0). Based on the experiments I made this would make perfect sense because (at least for my DSLR, dont know if this is valid for other DSLRs or professional CCDs) it appears that pixels behave too differently to just scale all pixels by the same factor k.

Georg

astropixel

  • Guest
 Yes, the read noise is evident. The cooled DSLR is limited by dew point for flats. Bias and darks not so. Did you have a temperature in mind. The maximum delta is ambient temperature -30C.

ruediger

  • Guest
Yes, the read noise is evident. The cooled DSLR is limited by dew point for flats. Bias and darks not so. Did you have a temperature in mind. The maximum delta is ambient temperature -30C.
You could run the test with two different temperatures, let's say 0°C and 14°C. If the heat noise doubles about every 6-7°C, the warmer darks should have 4 times the amount of noise. I'm really interested to see if the script works well.

astropixel

  • Guest
As requested.

F1, B1, D1 - 14C

F2, B2, D2 - 0C

ruediger

  • Guest
As requested.
Thanks for the contribution, but this script definitely needs more documentation and more checks of the supplied data before starting. :sad:
You supplied CFA RGB data, which is not wrong, but the script currently doesn't handle it correctly (only CFA gray allowed). Furthermore, the dark2 exposure time must be longer than dark1 exposure time to extract the heat noise. I will correct all this the next days and kindly ask you to run the test again then.

Rüdiger

astropixel

  • Guest
Second Try. Images are RAW Create RAW deBayer image - no black point correction - converted to grayscale.

Second dark 0C 120 seconds

Somehow managed to remove this image with no saved replacement???
« Last Edit: 2012 April 27 13:57:34 by astropixel »

ruediger

  • Guest
Second Try. Images are RAW Create RAW deBayer image - no black point correction - converted to grayscale.
We need a third and final try  :). The "RAW Format Preferences" must be set like shown in this post: http://pixinsight.com/forum/index.php?topic=4086.msg29127#msg29127, i.e. create RAW CFA image (monochrome), no black point correction, no white balance options set.
Also please swap D2 and D1. This should be it!

Are your flats well exposed? The data from columns C1/C2 indicates, that they are very dark. The mean ADU value of the flats should be around 70% of the max. ADU value. Normally I take flats with +1,5EV exposure compensation to move the histogram peak to the right.

Rüdiger
 

astropixel

  • Guest
Here is try #3. I have not had time to read the development threads - my apologies - squeezing in the time out of interest.

The interface is nice to use, but working from my laptop I can't see the bottom of the window - it's clipped and I can't resize it. Is there a documentation link? I'm sure the entire window is visible on a bigger screen.

The flats were taken with 75% camera histogram.

This is one is reporting in all fields. Mean D1 - B1 is negative.
« Last Edit: 2012 April 27 14:03:16 by astropixel »