Live Stacking Ideas

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
WB91
Posts: 27
Joined: Wed Jun 17, 2020 3:13 pm

Live Stacking Ideas

#1

Post by WB91 »

Robin,

1) Could you add "median" as a stacking option versus just having average?

2) For rejection method, any possibilities to add other rejection features, like MAD, or linear fit clipping, ESD?

3) Regarding the FWHM and brightness charts, could you add the ability to show the file name when you hover over it, this way we have the ability to know what a bad file might be so we can remove it? I don't know if you have used NINA software but they have a cool feature that allows you to flag a bad image from their image viewer and it automatically renames the image starting with "BAD" + "original file name" so that when you go into file explorer, you know which files were flagged as bad.

4) I read an interested article regarding luck imaging of DSO's. They mention a proprietary software that allows them to have a 32bit virtual memory when stacking at high gain, which I assume they can accumulate pixel values from multiple subs into a signal sub thus you have a better SNR image. So say user selects to accumulate 50 subs to create 1 image, but the process continues and each of these accumulated subs and will then be live stacked, and/or simply saved as FITS or within a SER file. Its like live stacking within a live stack. I hope this makes sense, but this could be an awesome feature to have as we could produce very detailed images. In fact, maybe we don't want to accumulate pixel counts and maybe take the median as an option. Re (1) in the aforementioned, it could be that you also add (Add, Max, Median and Average) as options, then the user could select "Add" which will fundamentally add the pixel values from a number of frames and then and live stack these and save. Then, at the same time, a second SharpCap window could be open live stacking these saved stack images. Now, it would obviously be better to do this all in one program window but the process could be tested like this, we just need more options other than Average. The only other thing we would need would be the ability to rescale these images from a virtual 32 bit to 16bit if need be. maybe this would be too much processing power no a PC, but then again, this would not be for high frame rate stuff like planetary, just DSO. Thoughts?

https://www.cloudynights.com/articles/c ... ging-r3220

5) During live stacking, would it be possible to automatically set a "reference image" via a push button so that offsets could be applied thus each frame could be normalized? So say you have already stacked 10 images, you can then click "update reference image" which your software could use an image with best FWHM and brightness and the live stack would restart using this image as your normalization reference. This would only work if you were saving the images to your hard drive and can be hidden if not selected to save. I realize this would be tricky with high frame rates but this could be an option only for DSO live stacking i.e. frame rates over 1 second as an example. Let me know your thoughts on this too.

Regards,
Bill
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Live Stacking Ideas

#2

Post by admin »

Hi Bill,

thanks for the feedback - some things are possible, others are not...

Median stacking is one of the impossible ones - in order to calculate the median of a series of numbers you need to consider all of them (get them in order, find the one half way through the ordered list). To calculate the mean, you only need to track the sum of the numbers and the count so far. This is important because SharpCap updates the image every time a new frame arrives, and in order to do that for a median it would have to recalculate the median value from scratch for each frame (loading the data from all previous frames, or keeping it in memory). Every frame would take longer to stack than the last. As far as I have been able to work out (and I spent quite a while thinking about this), there are no median calculating algorithms that properly solve this problem, so median is basically out for live stacking.

Other rejection algorithms - maybe - I would have to investigate the individual algorithms to see what data is needed at each pixel to make the rejection judgment. Sigma clipping requires 2 values stored per pixel (sum of pixel values, sum of squared pixel values), so more than simple averaging stacking, but still manageable, even when you have 20, 30, 40, 60 megapixel cameras (for the latter, the sigma clipping stack data runs to about 480 Mb).

Reading out the filename from the graph - yes, that sounds possible. Out of interest, why not use the 'save stacked' option for saving raw frames that will simple omit saving the bad frames in the first place? I do use NINA now and then, but hadn't encountered the 'bad' feature that you mentioned - a nice idea.

Finally, the lucky DSO imaging article pretty much describes SharpCap's live stacking algorithm (when using FWHM filter and default stacking) perfectly - internally, SharpCap uses 32 bit values for the sum of all the stacked pixels in default stacking mode. To reproduce the steps there, just make multiple live stacks (say 10 minutes total exposure from 5s frames) and then stack the saved stacks. The only thing in that article that is significantly different to SharpCap live stacking is the last bit about autoguiding based on the position of multiple stars, as far as I can tell.

cheers,

Robin
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Live Stacking Ideas

#3

Post by admin »

Just to dig a little further

MAD - relies on the median, which cannot be calculated for reasons explained above

Linear fit clipping - looks like it needs all the pixel values to be considered (from all subs), so therefore it is out for the same reason as median stacking

ESD - again, this looks like it needs all the pixel values to be considered when calculating the maximum deviation from the mean, which doesn't play nicely with the 'recalculate the stack at every frame' approach of live stacking.

I do have some ideas for this area though - one of the current problems with sigma clipping is getting a bad value (or values) during the first few frames when the sigma calculation is being initialized. It may be possible to store all pixel values for that limited period to deal with that problem. I also want to do something along the lines of detecting and removing satellite trails *before* they even get as far as the stacking algorithm. I will need some test images to prove if I can make that work in an automated fashion though.

cheers,

Robin
WB91
Posts: 27
Joined: Wed Jun 17, 2020 3:13 pm

Re: Live Stacking Ideas

#4

Post by WB91 »

Robin, thank you very much for responding, and I completely understand where you are at on all this. Dealing with PC memory is very tricky. Sounds like in order to improve sigma clipping an allocation to Ram or hard drive memory would be needed, which I think could be a good idea. Makes me wonder if it would be possible to do what you suggested and also what I suggested; say your memory allocation would be 10 frames, or a memory amount which can be determined by the user defined memory amount divided by the image size. So what if you memory stacked these files using "median" , then create the image to be used in your live stack but at the same time you clear your temp memory and repeat the process? Median should help remove outliers by default. The next question is, would it be beneficial to the next memory stack to include the previous stack as say image 1, or do we just start from scratch for each memory stack and only live stack each memory stack?

Regarding FWHM filtering, I guess the only problem with this is, if focus changes which it does, or seeing, when live stacking without saving frames, you really dont know what the best FWHM is as it could start out as 5 but end up below 3 but because you initially setup up to capture say 5, you then have to babysit it if the FWHM starts to drop. So what if we do the memory stack option, what if there was an option to reject the worst 5 of 10 FWHM frames within that memory stack? This should also improve stack quality by removing the worst frames caused by seeing conditions and it follows this method through the night. It could still be that the user can adjust FWHM levels throughout the night but atleast there is another rejection in place. thoughts?
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Live Stacking Ideas

#5

Post by admin »

Hmm, yes, the median of 10 frames and then taking means of those medians might be an interesting hybrid approach. I will have to work out how the noise level might respond to that sort of thing, as actually it turns out that median stacking is noisier than mean stacking (by a factor of about PI/2 I think). It should certainly be effective at removing satellite trails and the like. The trickiest part would be working out how to combine that sort of approach with the expected behaviour of live stacking - ie that the image improves with every frame and shows up after the first one :)

cheers,

Robin
WB91
Posts: 27
Joined: Wed Jun 17, 2020 3:13 pm

Re: Live Stacking Ideas

#6

Post by WB91 »

Robin, it would be worth a shot to at least have the option and test, so awesome news!!! The cool thing is, the median at say 10 frames or even 5 frames in memory stack would help with satellites but not so much for noise, but the live stacking which uses the memory stack would be in your current default stack mode which I believe is averaging. So this way the noise would eventually get stacked out anyways.

Last night I was testing some lucky imaging. I think the only thing that would really improve sharpcap would be having a one click auto focus run. I don't need to run a sequence, just need to do simple live stacking but when switching filters, the current focusing method is to time consuming. It would be nice to just click a button, auto focus and then get back to live stacking. When do you think you will have this option?
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Live Stacking Ideas

#7

Post by admin »

Hi,

auto-refocus is already done in the very latest updates to SharpCap 4.0. As long as you have previously done a manual focus scan/goto focus, you will find an 'Automatic Refocus' menu item in Tools->Focus Assistant. The automatic refocus will use your previous settings (direction, step size, number of steps, etc), basing the measurement range around the current focuser position.

cheers,

Robin
ChrisR Oz
Posts: 162
Joined: Tue Sep 28, 2021 11:03 am
Location: Melbourne

Re: Live Stacking Ideas

#8

Post by ChrisR Oz »

Hi Robin,

I use the single star FWHM method for focussing. Works well, and avoids issues with the number of stars changing when using the multi star mode. But it requires a tight region of interest that needs positioning. How can I use this with “auto focus”?

Still think that the “Out” scan button in the focus tool could work better if it simply offset by half the range first.
Cheers, Chris.
Celestron EdgeHD 8, reducer 0.7x, Star Sense, CGX-L mount, Focuser, CPWI; Starlight Xpress AO, OAG and Filter Wheel; ZWO 294MC/294MM Pro and 174MM mini; SharpCap Pro, PHD2, Televue Powermate 2x, Baader Neodymium, Astronomik CLS-CCD, ZWO UV/IR, Duo filters
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Live Stacking Ideas

#9

Post by admin »

Hi Chris,

ah, that could be an issue - I guess it would require a little window to pop up to say 'select the correct ROI for XXX focus then press OK'. That can happen.

As to the out button - I don't think that works as I tend to use the 'out' button more than once if I initially select a scan that doesn't quite reach the best focus point - I suspect others do the same. It would need a separate button. I will have a think.

cheers,

Robin
ChrisR Oz
Posts: 162
Joined: Tue Sep 28, 2021 11:03 am
Location: Melbourne

Re: Live Stacking Ideas

#10

Post by ChrisR Oz »

Ah yes. Didn’t think of that.
Cheers, Chris.
Celestron EdgeHD 8, reducer 0.7x, Star Sense, CGX-L mount, Focuser, CPWI; Starlight Xpress AO, OAG and Filter Wheel; ZWO 294MC/294MM Pro and 174MM mini; SharpCap Pro, PHD2, Televue Powermate 2x, Baader Neodymium, Astronomik CLS-CCD, ZWO UV/IR, Duo filters
Post Reply