Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Sum v Mean Stacking


HiloDon

Recommended Posts

Hi All,

I've been researching this issue of sum stacking v mean or average stacking and here's what I found so far. There are two very credible sources that believe that they are the same. Kyle Goodwin and Kieth Wiley both agree on this. Here's a link to Keith's discussion.

http://keithwiley.com/astroPhotography/imageStacking.shtml

I ran my own experiments on this and here are two images I took of the Rosette Nebula with both sum and mean stacking in Lodestar Live with the LS X2c and NB Ha filter. Any difference can probably be attributed to error in my adjustment of the brightness. I would say that it is easier to use mean, but I like sum because I can set the image brightness low and watch it develop into a final image. Both though appear to end in a similar, if not equal, result.

Don

post-36930-0-91101500-1423634186.jpg

post-36930-0-27229400-1423634226.jpg

Link to comment
Share on other sites

Hi Don

We're all in agreement. In theory, since mean is just sum/(number of subs), they are the same as mentioned here

http://stargazerslounge.com/topic/226403-the-joys-of-sum-stacking-with-lodestarlive/

But in practice they may not be the same (hence the title of that thread). For them to be identical we need to be sure that (i) everything is done in floating point at the earliest possible stage, and  (ii) all the information fits into the available range after returning to integers for display purposes, and perhaps also (iii) none of the intervening processes has resulted in values going beyond the available range prior to scaling by the number of subs. I'd add a fourth condition too: for faint stuff quantisation noise might be an issue. 

This latter possibility can be visualised like this. Suppose you've got an exceedingly faint target that is represented amongst the low order of bits in the digital representation. Sum stacking will ensure that it moves up the range of bits, whereas mean stacking will keep it down in the lower range, where it might get masked by quantisation noise. I've no idea if this is ever an issue in practice but it seems at least possible in principle.

What would be a useful experiment would be to go back to v0.10 and see if you can obtain identical(-ish) results.

cheers

Martin 

Link to comment
Share on other sites

Hi Richard,

Yes, that is true. If you don't manually adjust the brightness and contrast, the image will wash out. That's why most users prefer mean stacking. It does the same noise reduction and in a sense automatically controls the brightness level to the original setting. I am by no means an expert on this. I was hoping that Paul will visit this thread and clarify anything that may be incorrect or misleading. I am just sharing my experience and what other more knowledgeable people have written about this.

The other thing I have confirmed is what Dom has posted in other threads. The stacking feature reduces noise for about five stacks, after which no further improvement is observable. This is true for both sum and mean stacking.

Don

Link to comment
Share on other sites

The other thing I have confirmed is what Dom has posted in other threads. The stacking feature reduces noise for about five stacks, after which no further improvement is observable. This is true for both sum and mean stacking.

I wonder if this is because the noise reduction is not a linear function of the number of frames (I think the relationship is exponential?) and you're reaching the point where you need a lot more frames to make any perceivable difference?

James

Link to comment
Share on other sites

Hi James,

The way Keith Wiley explains it in his write up is that as the images are stacked the noise component converges to zero. So, I would think you are right, more images are required to get a reduction as more are stacked. I think you still get improvement as you stack beyond five, but at some point it becomes unobservable.

Don

Link to comment
Share on other sites

Noise reduction due to stacking follows a square root rule. You need 4 frames to halve the noise, 16 frames to reduce it to a quarter, and so on e.g. 100 to reduce it to a tenth. That's just the noise in the pixel (not related to dark current, read noise etc). So like everything its a case of diminishing returns. However, especially for short exposures I leave the stacking going while I observe even if it gets up to 100 subs. Of course, live stacking itself isn't 100% accurate and that can also be considered a source of noise, so there are tradeoffs. Gusty nights are the worst.

There's a great source of articles on Craig Stark's site

Martin

Link to comment
Share on other sites

Lots of very interesting points in this thread and the linked articles.

If I am honest, I have not done a deep mathematical analysis of the different modes, when developing the live stacking it seemed easiest to offer sum, mean and median and let the natural world of user experience eventually decide which is the best to go for.

Stacking is always performed in unsigned 16-bit numeric space, hence why its quite easy for sum to reach saturation. It is restricted to 16-bits due to constraints further down the chain (offline processing has an advantage here...).

From my own experiences, median stacking often results in smoother, less noisy images. Mean I rarely use, you get similar results to median but median is less prone to outliers causing more noise than necessary. Sum stacking results in a noisier image than median, but seems to bring faint stuff out of the background noise better - I echo a point here from Martin on this front.

As for the number of exposures, I also agree with the general consensus on the forum, you see great benefit up to about 5, a from there it is diminishing returns to about 10 and after that there really is little perceived benefit. This would fit with the theory of the noise reduction following the square root rule. I tend to observe for about 10 subs, all the while using the display processing to tease out different features.

When time allows I want to play with the hybrid stacking which sum stacks (a user selectable) number of subs and then median combines those super subs - just to see what difference it might make.

Link to comment
Share on other sites

From my own experiences, median stacking often results in smoother, less noisy images. Mean I rarely use, you get similar results to median but median is less prone to outliers causing more noise than necessary. 

This is what sigma stacking is designed to deal with.  You take the mean, but then disregard anything more than some constant multiplier of standard deviations from the mean when creating the stack.  You do need more frames for the process to work well though.  I think it's sometimes described as Kappa-Sigma stacking, where Kappa is the constant.

I wonder if it might also be interesting to sum the pixels that pass the Kappa-Sigma test, replacing those that fail with the mean.

James

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.