Jump to content

Banner.jpg.32030495336bee81a52546621b6f39a2.jpg

Image combining -theory & practice


centroid

Recommended Posts

As its cloudy, and I'm bored, I thought I'd compare the various alogorithms for combining images.

That is: Addition (sum), Average, SD Mask and Sigma Clip.

I took the 11x600sec subs of IC443, that I took recently, and combined them using the four different algorithms listed above.

No post combination processing was applied, apart from an identical amount of 'stretch' applied in P/Shop.

Having read the theory behind each image combination algorithm, and the quoted benefits of one over the other, I was somewhat surprised to see no differnce what so ever, in the four resulting images :(

Of course, this was only a visual analysis, but I looked long and hard at the four images, alongside each other, but just couldn't see any difference.

I'd be interested to hear of your experiences, if you have ever compared them.

Dave

Link to comment
Share on other sites

The images were all handled as 16 bit Integers, as seeing that I wasn't going to be applying any filtering, I didn't envisage quantisation being an issue.

Therefore, theoretically, all the combination algorithms applied, should have been numerically different.

Dave

Link to comment
Share on other sites

Dave, I assume you're using the -H9C for this? The advantages of sigma-clipping are mainly in removing noise, so there are reduced benefits to using it with a low-noise CCD.

As for signal-to-noise, I agree with Mark - my understanding is that they're equivalent, excluding the outlier-elimination of sigma clipping. So i'm not surprised that you can't see a difference.

Personally I use averaging, but that's only because I have a rather old PC and that has lower memory requirements than sigma-clipping.

Link to comment
Share on other sites

Hi Ben, and thanks for your input.

As I read it,

Add/Sum is reckoned to give the best performance in most situations, but of course adds any noise too.

Average, as expected, adds all the pixels, then divides them by the number of images.

Median helps if some pixels are very bright or very dark (I never use this one).

Sigma Clip and SD Mask, combine the best of Median and Average, but as you say, is far more processor intensive.

So, theoretically, Sigma Clip and SD Mask "should" be better than either Averge or Meadian, and therefore must be numerically different. If not numerically different, then they would be either just Average of Median.

I am indeed using the H9C, and as both Sigma Clip and SD Mask are theoretically better at handling noisy pixels, then perhaps as you say, with the H9C being a low noise camera, noisy pixels aren't an issue. Hence, the lack of difference that I'm seeing.

All interesting stuff though, especially when its cloudy :(

Dave

Link to comment
Share on other sites

Dave,

I did the same trick some while back and found completely different results. I used a different number of frames, something like 3, 6 and 10 and was looking for two things. The resultant background noise and the ability of the various algorithms to reject outliers. Average gave the least noise in a statistically meaningful value. I looked at R Croman's Sigma Reject or whatever it is called and compared it to Maxim's SD Mask. The rejection of outliers was about the same but the SD Mask noise was lower. A slightly surprising result given what I had read. I kept the files and I will try to find them and either post or bring them over for the next meet.

Dennis

Link to comment
Share on other sites

One other advantage of median or sigma-clipped that I forgot is an ability to deal with satellite trails much more effectively, so that is a bonus.

I rather suspect that you need to look at the statistics of the image to see a difference between the methods, visually it's likely to be hard to tell unless maybe you're doing extreme stretching ... which I guess (for most of us) is an argument for keeping it simple.

It's been a few years since I 'did the math' but my recollection is that provided you're using floating point arithmetic summing and averaging are identical. A quick Google suggests that (a) my memory is right and (:( it's something that triggers endless debates on Cloudy Nights

Hopefully narrowbandpaul will be along in a bit, he's likely to have thought it all through. I'm posting quickly during moments waiting for a compiler to do its stuff at work, so i'm going from memory...!

Link to comment
Share on other sites

If you have nice clean images free of random hot pixels, gamma ray bursts and satellite trails then average is the one to go for. The differences wont be noticeable compared with median though if you have a good few frames. Surprised you didn't notice a difference with between average and median from 11 frames though Dave. Maybe it was because with 10min frames you had pretty good s/n ratio. Using median is effectively like dropping 2 sub frames. I can normally tell a difference if I only have a few frames.

For sigma reject to do it's job effectively you do need enough frames for a proper stat analysis. 11 frames is pushing it. If you had clean subs Dave sigma reject will simply have done an "average" stack.

I normally use sigma reject because it gets rid of crud such as satellite trails whilst effectively doing an average combine

Link to comment
Share on other sites

Martin/Ben, I didn't include Median in my test run, as its one that I don't normally use. I did know about its potential effectiveness with regards to satellite trails. However, applying a radius of more than 1 pixel starts to remove detail that you don't want to lose.

I wasn't aware that the Sigma Clip was useful in the same respect though, so that's useful info.

I did actually stretch the images quite hard, in order to look at the visual noise content, but jsut couldn't see any difference.

As I said earlier Ben, I kept all the images in Integer format, so that if there was a difference between Average and Sum, I might be see it.

It will be interesting to see Dennis's results.

Still, as I said, its all interesting stuff, and makes for stumulating discussion.

Dave

Link to comment
Share on other sites

The whole idea of sigma reject is that it is an average stack except for those situations when it shouldn't be i.e pixels which lie a long way from the mean. So there shouldn't be any difference. I think the floating point vs integer differences are likely to be pretty small.

Link to comment
Share on other sites

Dave, here is a quick view of one of my results. A lot of the detail was lost in the translation to small jpeg so don't take what you see as gospel.

There are three results here. A combination of 3, 6 and 10 subs using Median, Sigma Clip and SD Mask. You can see as you look down each column that the satellite trail, shown as an inset, is progressively reduced. The information pallette from Maxim in the bottom LH corner shouldn't be there. The two sigma type combinations get rid of the sat trail much more quickly.

I did a quick measure of a similar part of each frame in PS and it shows quite clearly that the Standard Deviation or noise is reduced as each result includes more subs. SD Mask is definitely better in this test but the noise from the two sigma type operations converges as the number of subs is increased. Ergo, combine twenty subs and there is probably no difference between Sigma Clip and SD Mask.

Doing this convinced me of one thing at least; taking very long subs means you might have only three or four at the end of the night. That is nowhere near enough to reject all the rubbish. Having enough subs, ie 8 or more, means you do not have to reject any of them because of aircraft or sat trails or cosmic ray hits.

It still puzzles me why I keep reading about people rejecting subs for these reasons. There is no need to do it.

Someone mentioned the possibility of a talk at the next SGL E Anglian meet if the weather is bad again. Perhaps this would be a good subject.

Dennis

post-15519-133877356073_thumb.jpg

Link to comment
Share on other sites

Thanks for that Dennis, it certainly proves the point of how sat trails are reduced, by using SD or Sig algorithms.

The pro and cons over fewer but longer exp subs, compared to more subs, but with shorter exp, is not quite a straight forward as it might seem. In my experience, its very much a 'balancing act' between avoiding the loss of any long exp subs (say due to aircraft), and capturing enough fine detail.

I think its pretty much accepted that 4x15 min subs, will contain more info than 12x5 min subs.

However, with CDD imaging, if the subs are too long, then the law of diminishing returns starts to apply.

Personally, from my location, with its reasonably dark sky, I wouldn't want to 'push it' any longer than 20 mins, and preferably no longer than 15 mins.

The whole subject of CCD image capture and processing, could fill several meetings, and still only 'scratch' the surface.

Dave

Link to comment
Share on other sites

Steve ... how dare you come out like that :( Certainly means you use everything that you have "captured" and might be an option with the 1000D

I tend to use median but also make sure I have an odd number of frames to stack...

If I have loads then I use auto adaptive average ...

Billy...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.