PixInsight Forum (historical)

PixInsight => Release Information => Topic started by: Juan Conejero on 2010 June 20 15:39:45

Title: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Juan Conejero on 2010 June 20 15:39:45
NOTE -- This thread is obsolete - for up-to-date information on the new linear fit clipping pixel rejection algorithm please go to this thread (http://pixinsight.com/forum/index.php?topic=2169.0).
Sorry for the inconvenience.


Hi there,

The new version of the ImageIntegration tool that comes with PixInsight 1.6.1 implements a new pixel rejection algorithm: RANSAC linear fitting. This is the first of a series of improvements in this essential tool, which will be introduced during the 1.6.x cycle.

The random sample consensus (RANSAC) algorithm (http://en.wikipedia.org/wiki/RANSAC) is already being used in PixInsight with great success. The StarAlignment tool implements a sophisticated RANSAC procedure as the final stage of its star matching engine. The main advantage of RANSAC is its robustness (http://en.wikipedia.org/wiki/Robust_statistics). In the case of the new rejection method implemented in ImageIntegration, RANSAC is used to fit the best possible straight line (in the twofold sense of minimizing average deviation and maximizing inliers) to the set of pixel values of each pixel stack. At the same time, all pixels that don't agree with the fitted line (to within user-defined tolerances) are considered as outliers and thus rejected to enter the final integrated image.

The new pixel rejection algorithm is controlled, as usual, with two dedicated threshold parameters in sigma units: RANSAC low and RANSAC high, respectively for low and high pixels. The screenshot below shows the new version of ImageIntegration and some results of the new rejection method.

(http://forum-images.pixinsight.com/1.6.1-preview/ImageIntegration-01-tn.jpg) (http://forum-images.pixinsight.com/1.6.1-preview/ImageIntegration-01.jpg)
Click on the image for a full size version

The next screenshot is a comparison between an integrated image (raw data courtesy of Oriol Lehmkuhl and Ivette Rodríguez) with the new RANSAC fitting rejection (left) and without rejection (right). Both images integrate 10 frames with signal-to-noise improvements of 2.86 and 2.92, respectively. SNR degradation is very low with excellent outlier rejection properties.

(http://forum-images.pixinsight.com/1.6.1-preview/ImageIntegration-02-tn.jpg) (http://forum-images.pixinsight.com/1.6.1-preview/ImageIntegration-02.jpg)
Click on the image for a full size version

The new RANSAC linear fitting rejection requires at least five images. It is best suited for large sets of images (>= 8).
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 20 23:27:40
Very nice Juan - keep up the good work!!

When all the sub-panels if ImageIntegration are 'expanded', does the GUI still fit on a 1920x1200 screen? If not, you might want to re-think the layout, otherwise screenshots, video tutorials, etc., are going to be difficult in the future - and remember, not everyone has the luxury of 1920x1200 either.

Cheers,
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 22 12:45:20
When are we going to get a script or something to help link the work flow process together?
ie calibration, registration, and integration.

No one has stepped forward to write this yet.

Max
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Harry page on 2010 June 22 13:07:50
Hi

Iam still with you max  >:D

Harry
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Harry page on 2010 June 22 13:09:32
Hi Juan

Why will this be better than the winzorised rejection method , which is very good  ;D

Harry

Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 22 13:45:38
Hi Harry,

The following is how I understand the various forms of 'clipping'

Percentile Clipping (the simplest) - any data that is too far away from the central peak of a distribution curve is simply excluded from the integration process

Sigma Clipping - an iterative approach, whereby data ouwith the clipping zone is set to zero, and plays no further part in iterations. The clipping points are set in terms of k-sigma units, where 'sigma' is the 'standard deviation' of the data set. The aim of iteration is to fine-tune the 'mean value' of the data-set from that which is calculated when NO DATA is clipped, to that which is re-calculated after the data outside the k-sigma points has been eliminated. Each iteration loop will be based on fewer and fewer data elements as the data is clipped more and more

Winsorised Sigma Clipping - is very similar to Sigma Clipping, with the important exception that the number of data points in the set remains the same throughout the clipping iterations. This is because data is not ELIMINATED outside the clipping zone - instead all data points outside the clip-zone are substituted with the data value AT the clipping point.

RANSAC Clipping - if my assumptions are correct, it proceeds in a similar fashion to Winsorised Sigma Clipping until a certain 'quality' point is reached in the iteration process. At that point, the assumption is made that all the data points are so similar in value that they should more or less fall on a 'straight line' if plotted on a graph. The algorithm will then set out to establish the 'best fit' straight line through these data points. Importantly, this 'straight-line' will also have to be HORIZONTAL, and it is the 'height' of this line that gives the 'average result' that we are looking for.

So, the main difference is that Winsorisation does NOT make the final hypothesis that the data-set could, plausibly, all have had the SAME original value in the first place.

Now, this is only MY INTERPRETATION - and it is simplistic at that. Although I do 'understand' the principles behind Winsorised Clipping, thanks to hours of Google-pedia research, and gentle kindness from Juan, what I have not (yet) done is repeat that research on the principles behind the RANSAC algorithm.

Juan (and others??) will (as usual) help to clarify things - and then we will get to 'experiment' when it makes its appearance in Vx.y.z  ::)

Cheers,

Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Harry page on 2010 June 22 13:51:44
Crickey that nearley made sense  8)


Harry
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 22 13:53:45
Which probably means that I have 'got it wrong' somewhere :'( :'( :'(
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: RobF2 on 2010 June 23 00:43:10
Hi

Iam still with you max  >:D

Harry

I wonder if we nonchalantly threw this in as a request to Nikolay if he'd do it with default parameters as part of his animation script.....
 :D   ;)     (every other suggestion has come back in a day or two!)

The RANSAC integration option sounds like a great new addition thanks Juan - the stacking seems to give exceptional quality even in my beginner's hands versus any other program I've tried, so any improvement in this critical area more than welcome.  These are things people have to take notice of in the marketplace too.....
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Harry page on 2010 June 23 03:04:32


I have offered him a few beers  :D

Harry
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: NKV on 2010 June 23 03:36:41
I wonder if we nonchalantly threw this in as a request to Nikolay if he'd do it with default parameters as part of his animation script.....
Friends, if you like to see simple calibration (by master files w/o dark optimization) in animation script, I will do it. It's easy to implement. You really want to see result w/o dark optimization?

When are we going to get a script or something to help link the work flow process together?
ie calibration, registration, and integration.
For me it's: integration ( masters ) > calibration > registration > integration.
How you like to care all settings for this long process? You want to see 7 tabs (bias/dark/flat/darkflat/calibrate/register/integration) and many-many buttons/checkers/slider/list on every tab?
You really want to get the monster?
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Juan Conejero on 2010 June 23 04:12:59
Perhaps some confusion has arisen due to my choice of a wrong title for this thread. Actually, the most important part of the new rejection algorithm is linear fit, not RANSAC. The use of the RANSAC algorithm is an implementation detail, but the core of the method is that we are fitting all pixels in a stack to a straight line. In fact I am considering the possibility of not using RANSAC at all, in favor of other robust algorithms that are more efficient.

The difference between linear fit clipping and sigma clipping is best explained with a graphical example. Consider the following figure.

(http://forum-images.pixinsight.com/II/sigma-clipping.png)

Suppose we are integrating N images. In the figure, we have represented a stack of N pixels at the same coordinates, whose values have been sorted in ascending order and plotted as circles on the graphic. The horizontal axis is the ordered sample number, and the vertical axis represents the available range of pixel values.

What we pursue with pixel rejection is to exclude those pixels that have spurious values, such as pixels pertaining to cosmic rays, plane and satellite trails, and other too high or too low pixels that are not valid data for some reason. We want to reject those pixels to make sure that they won't enter the integrated image.

The symbol m represents the median of the distribution. The median is the value of the central element in the ordered sequence, which in statistical terms corresponds to the most probable value in the distribution. Here, the median is being used as a robust estimate of the true value of the pixel, or more realistically, the most representative value of the pixel that we have available. Robustness here means unaffected by outliers. An outlier is a value abnormally low or high, as are both extreme values in the graphic, for example. Outliers are precisely those values that we want to exclude, or reject. By contrast, valid pixel values or inliers are those that we want to keep and integrate as a single image to achieve better signal-to-noise ratio. Our goal is to reject only really spurious pixels. We need a very accurate method able to distinguish between valid and not valid data in a smart way, adapted to the variety of problems that we have in our images. Ideally no valid data should be rejected at all.

With two horizontal lines we have represented the clipping points for high and low pixels, which are the pixels above and below the median of the stack, respectively. Pixels that fall outside the range defined by both clipping points are considered as outliers, and hence rejected. In the sigma clipping algorithm, as well as in its Winsorized variant, clipping points are defined by two multipliers in sigma units, namely KH and KL in the figure. Sigma is an estimate of the dispersion in the distribution of pixel values. In the standard sigma clipping algorithms, sigma is taken as the standard deviation of the pixel stack. These algorithms are iterative: the clipping process is repeated until no more pixels can be rejected.

In the figure, rejected pixels have been represented as void circles. Six pixels have been rejected, three at each end of the distribution. The question is, are these pixels really outliers? The answer is most likely yes, under normal conditions. Normal conditions include that the N images have flat illumination profiles. Suppose that some of the images have slight additive sky gradients of different intensities and orientations —for example, one of the images is slightly more illuminated toward its upper half, while another image is somewhat more illuminated on its lower half. Due to varying gradients, the sorted distribution of pixels can show tails of apparent outliers at both ends. This may lead to the incorrect rejection of valid pixels with a sigma clipping algorithm.

Enter linear fit clipping:

(http://forum-images.pixinsight.com/II/linear-fit-clipping.png)

In this figure we have the same set of pixels as before. However, the linear fit clipping algorithm is being used instead of sigma clipping. The new algorithm fits a straight line to the set of pixels. It tries to find the best possible fit in the sense of minimizing average deviation. Average deviation is computed as the mean of the distances of all pixel values to the line. When we find a line that minimizes average deviation, what we have found is the actual tendency in the set of pixel values. Note that a linear fit is more robust than a sigma clipping scheme, in the sense that the fitted line does not depend, to a larger extent, on all the images having flat illumination profiles. If all the images are flat (and have been normalized, as part of the rejection procedure), then the fitted line will tend to be horizontal. If there are illumination variations, then the line's slope will tend to grow. In practice, a linear fit is more tolerant to slight additive gradients than sigma clipping.

The neat result is that less false outliers are being rejected, and hence more pixels will enter the final integrated image, improving SNR. In the figure, r is the fitted line and d represents average deviation. HL and KH, as before, are two multipliers for high and low pixels, in average deviation units. However, instead of classifying pixels with respect to a fixed value (the median in the case of sigma clipping), in the linear fit algorithm low and high pixels are those that lie below and above the fitted line, respectively. Note that in the linear fit case only two pixels have been rejected as outliers, while the set of inlier pixels fit to a straight line really well.

The remaining question is: is linear fit clipping the best rejection algorithm? I wouldn't say that. Linear fit rejection requires a relatively large set of images to work optimally. With less than 15 images or so its performance may be worse or similar to Winsorized sigma clipping. To reject pixels around a fitted line with low uncertainty, many points are required in order to optimize it in the least average deviation sense. The more images, the better linear fit is possible, and hence the new algorithm will also perform better. It's a matter of testing it and see if it can yield better results than the other rejection algorithms available, for each particular case.
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Juan Conejero on 2010 June 23 04:17:04
Nikolay,

Quote
You really want to get the monster?

My advice is to avoid asking that kind of questions to these guys. They tend to say yes when they see the words "want" and "monster" together  >:D

Beer? someone said beer?  :-*
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 23 04:44:22
Hi Nikolay,

You know, I do honestly think that we need to start with the belief that we MUST end up with the 'monster'

We certainly need a tab for each group if captured sub (so, that means Lights, Darks, Flats, FlatDarks and Biases). And each tab group can then be populated as required by the user

It could even be argued that these five tabs could be replicated as sub-tabs in a parent-level tab structure, covering up to four channels (allowing for a 'one-touch' L+R+G+B integration).

By this stage, all that will have been implemented is the ability to advise PI of which 'source images' belong to which 'tab group'. A sophisticated GUI would allow quick re-use of one group of data in the same group-type of another tab - if appropriate, and under user control.

Now, working up-and-down the two primary tab-levels (top level==channels; bottom level==sub-frame types) and left-to-right (either channels, or sub-types) the user can then fine-tune the images that will ACTUALLY be used in the 'integration' stages. This is where I see your 'Animation' script sitting.

In other words, for a given channel, and a given sub-type, the user then inspects the loaded images and enables/disables those images which are visually unacceptable for further inclusion. Obviously, as the 'image inspection' powers of PI increase, this can even become an 'automatic' process - where images are 'scored' in a similar fashion to DSS, and excluded from further processing based on some overall score and user-definable threshold (thresholds being set either 'globally' or 'locally', on a tab-by-tab basis). The auto-scoring and global thresholding allow the user to get closer and closer to a one-click "Go For It" button - that will result in PI spitting out one calibrated image per assigned (top-level) channel.

Within the lower-level subframe-type 'tabs', the user then has to deice what is going to happen to the 'selected' images (remember, these may have been 'auto-selected' as described above).

At the simplest level, for example, Biases would just be ImageIntegrated - they would not need to be ImageCalibrated. However, even this 'simplest level' may need to consider using the ImageCalibration process, if the Bias frames are to be calibrated using OverScan data. No matter though, only when ALL appropriate parameters have been entered or selcted - and they have been validated as being 'acceptable' (rather than 'nonsense'), only then would the 'Biases' tab be 'green lighted'. I foresee some sort of 'summary screen' that would show the 'green light' status of ALL the tabs in use. The user could either then process JUST 'that tab', or could wait until ALL the tabs had been correctly configured, such that a 'master' green-light was indicated, and could then just hit the global "Go For It" button.

Obviously, as different sub-types require extra levels of calibration, these have to be set up correctly as well. For example, a 'Darks' tab could not be 'green-lighted' if it referred to calibration using a MasterBias, if the associated 'Biases' tab was itself not 'green-lighted'. The same approach would work up, all the way to the 'Lights' tabs - which (if the user had set it up to need 'full calibration') would require 'green lights' for ALL associated sub-stages. And, obviously, it would take ALL the 'Lights' tabs for ALL the 'Channels' tabs to be 'green-for-go' in order to enable the global "Go For It" button.

Now, this approach is certainly one way to fulfil the 'one-click' facility that some users are looking for. It may even fulfil simpler needs as well. It is probably overkill for someone like me, who needs to 'tweak and tune' the various clipping sliders (etc.)  on the ImageIntegration process. But, it might NOT be overkill in thatt situation, if I also want to see how the ImageIntegration process behaves as I quickly enable/disable selected images through your 'Animation' interface.

And, it might also not be overkill, as I can then use your Animation interface on sub-types higher and higher 'up the food chain' - where any calibration data that IS applicable to the sub-level that I might be Animating can be (optionally, as always) applied 'on the fly')

Finally, it could also be the case that the 'Channel' tab is a 'special case' - and has extra parameters to define that the frame data contained in the sub-groups below it is all RAW data from a One-Shot-Colour camera. These parameters would define which type of deBayering algorithm would need to be invoked, and whether debyering happened on a sub-type by sub-type basis (resulting in 'full-colour' Master frames), or whether deBayering happened just before ImageAlignment, or whether deBayering happened AFTER final integration of the calibrated RAW frames.

An extra tab, or pop-up GUI DialogueBox could be invoked to handle these scenarios.

So, Harry, you had better start shipping beer to Nikolay every day from now on ::)

Cheers,
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: harist on 2010 June 23 05:22:22
Quote
How you like to care all settings for this long process? You want to see 7 tabs (bias/dark/flat/darkflat/calibrate/register/integration) and many-many buttons/checkers/slider/list on every tab?
You really want to get the monster?

ImagePlus has a well thought tabbed interface for the whole process. AA4 is not bad either but not as "clean" as IP.

Tasos
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: RobF2 on 2010 June 23 05:38:07
Nikolay,

Quote
You really want to get the monster?

My advice is to avoid asking that kind of questions to these guys. They tend to say yes when they see the words "want" and "monster" together  >:D

Beer? someone said beer?  :-*


Yes! Yes! Yes!   (to monster AND beer : :P)

I actually had in mind the bare essentials to start with - a script that called saved process icons preconfigured with your library bias/darks/flats and usual integration settings.  You would run it for each filter then manually do RGB or LRGB combines.  Could even be a button on your fantastic animation script that called process icons for Image cal, alignment, then stacking - that alone would be a huge benefit saving have to specify related images over and over.  I know some people don't like the idea of library calibration images, but a lot of us do work this way.  

The "monster" with tabs and endless configuration for each filter/channel would be the ultimate - I get frightened of asking the IT guys at work for the ultimate though 'cause they get frightened off and I get nothing..... :yell:

Perhaps this should go to another thread though if you do run with it Nikolay - to get us out of Juan's excellent integration explanation?

Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Jack Harvey on 2010 June 23 05:56:36
Howdy, Guess i am a little late to the party.  Only one small point.  I note you have included a tab for DarkFlat n your proposed Frankenstein of processing tools.  I have yet to hear a good argument as to why Flats need to be dark calibrated.  Bias Yes! Dark, not so much?
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 23 06:29:21
I wonder if we nonchalantly threw this in as a request to Nikolay if he'd do it with default parameters as part of his animation script.....
Friends, if you like to see simple calibration (by master files w/o dark optimization) in animation script, I will do it. It's easy to implement. You really want to see result w/o dark optimization?

When are we going to get a script or something to help link the work flow process together?
ie calibration, registration, and integration.
For me it's: integration ( masters ) > calibration > registration > integration.
How you like to care all settings for this long process? You want to see 7 tabs (bias/dark/flat/darkflat/calibrate/register/integration) and many-many buttons/checkers/slider/list on every tab?
You really want to get the monster?

Sounds like a good plan. You might want to look at MaxIMs calibrate and Stack commands for ideas.
They did a nice job on the worth flow but PI has better processes now.
You did a great job on blink. I think you can handle it!

Max

Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 23 06:48:24
The more images, the better linear fit is possible, and hence the new algorithm will also perform better. It's a matter of testing it and see if it can yield better results than the other rejection algorithms available, for each particular case.


Great explaination.

We will have see how it works out in practice.
I commonly get 15-25 images, so it is worth a try.

The hardest problem to deal with is slight changes in transparency this can occur even on very good nights. These end up being complex gradients. It is hard to identify the inliers.

(  Of course this does not fix the gradients , we still do DBE after our integration)

Max
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 23 07:22:06
Hi Jack,

Quote
Howdy, Guess i am a little late to the party.  Only one small point.  I note you have included a tab for DarkFlat n your proposed Frankenstein of processing tools.  I have yet to hear a good argument as to why Flats need to be dark calibrated.  Bias Yes! Dark, not so much?

The reason I have included this is that this is how I have ALWAYS calibrated my imaging data. My Flats tend to be acquired as 2s exposures (or more, for NB data). And, as far as I am concerned, there is enough 'dark' signal at 2s to allow it to be statistically evaluated and therefore correctly eleiminated by using a MasterFlatDark.

I am 'not comfortable' with Biases being used to calibrate Flats, unless the Flats can be demonstrated to have no 'significant' signal attributable to 'thermal noise'. Certainly, because of the ultra-short Bias exposures, no statistical 'thermal' signal can be obtained. So, if the same cannot be said for the Flats, then using only a MasterBias to calibrate the Flats will still leave the MasterFlat with a thermal-noise content.

Then, is there not also the issue with the likes of full-frame CCDs? There is a finite minimum shutter-speed that these will operate with, and that shutter-speed is SIGNIFICANTLY longer than typical exposure times for Bias frames. So, I would want to be using multi-second FlatDarks once again, and just not bothering with Bias frames at all (because, they really just will NOT be 'true' Bias frames, because their exposure times will be too long). Have I just failed to understand something here?

In any case - I think it would be wrong to 'force' users to work with Biases as FlatDarks. I think that the option should remain a 'user option'.

Cheers,
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 23 08:05:20
Keeping the option is fine.

Unless your camera has very high dark current or your flats are several minute long you are most likely wasting your efforts. 

My camera generates a only a few electrons under one minute.

I could be helpful with a uncooled camera such as DLSR in warm weather.

Max
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: NKV on 2010 June 23 08:56:09
Beer? someone said beer?  :-*
Juan, take beer, beer from Harry and all who really want to see the 'monster'. And just for fun, I'll be happy to send you a beer, if you collect all the tools in the 'one-click monster'.

I really not understand why so many people want to see DSS inside PI ? Maybe because everyone like use familiar tools... or not want to get best result from given sources. Some times I like to see fast result, but it's just for nothing or just for web publication. Really I see only one situation where the 'monster' might be useful: generation of images for a garbage.

I used DSS and other software like 'one click' preprocessing, but I newer happy with final result. Yes, we can to set all the settings at once, then press the button "make nice" and wait for a masterpiece. But do not come Masterpieces ... maybe better to focus on each step separately. Really there is not enough in PI is a tool for analysis. I prefer control and analyse result of everyone step, so IMHO the module structure of PI processing is best of the best solution for best result.

Friends, you really think the 'monster' can generate APOD ? Or any reason why you not want to do preprocessing step-by-step.

Also, I don't want to see PI in one line with other 'one click software'.
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Jack Harvey on 2010 June 23 09:00:31
Niall  My understanding is with modern cameras, the build-up of dark current is minimal if the flat exposure time is kept reasonably short. Typically, dark current may be ignored at exposure durations less than 30 - 45 sec. Only a master bias subtraction is needed to calibrate flat frames ;)

Nikolay  Darn I was hoping there would be a checkbox that would send the appropriately sized image to Jerry Bonnell et al at APOD for automatic publication:-(   Seriously I agree that for quality imaging every step of the processing needs to be carefully monitored.  It takes hours, days or even weeks to gather your data, why does it have to be processed in a few minutes?  Just my two cents worth.
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 23 10:54:45
Beer? someone said beer?  :-*
Juan, take beer, beer from Harry and all who really want to see the 'monster'. And just for fun, I'll be happy to send you a beer, if you collect all the tools in the 'one-click monster'.

I really not understand why so many people want to see DSS inside PI ? Maybe because everyone like use familiar tools... or not want to get best result from given sources. Some times I like to see fast result, but it's just for nothing or just for web publication. Really I see only one situation where the 'monster' might be useful: generation of images for a garbage.

I used DSS and other software like 'one click' preprocessing, but I newer happy with final result. Yes, we can to set all the settings at once, then press the button "make nice" and wait for a masterpiece. But do not come Masterpieces ... maybe better to focus on each step separately. Really there is not enough in PI is a tool for analysis. I prefer control and analyse result of everyone step, so IMHO the module structure of PI processing is best of the best solution for best result.

Friends, you really think the 'monster' can generate APOD ? Or any reason why you not want to do preprocessing step-by-step.

Also, I don't want to see PI in one line with other 'one click software'.

After I remove the bad images automation usually works just as well as step by step.

If you have the option to save images at each step you can troubleshoot your problems fairly easily.

Likewise if you want to integrate again with different parameters you have aligned and calibrated images.



It is just another tool .

You can spend your time on where it counts best.
You must validate manually that your calibration and aligments settings generally work without problems.
I find that once I have this working for a image set or camera the rest goes smoothly.

"you really think the 'monster' can generate APOD"

It is not about fast quick and dirty methods just to generate a pretty picture.
It is about an effective process.
I just don't like to waste my time starring at a busy hour glass cursor doing the same thing over and over again.

If you don't have the desire to do this someone will eventually take it on.

Max



Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Harry page on 2010 June 23 11:15:25
Hi Juan

I use many dozens of images in my stacks and anything that helps is great , and I have offered you wine before , now you want beer

Niall

I never use darks full stop . and I must say if your camera gains statistically important dark current in a few seconds , its time to get a new camera  >:D
But seriously you can add more noise by doing this and this is one reason why most people use just a bias frame

Nikolay

I am up for the monster and can do draught beer if its required  ;D

I do not see making the process more user friendly a disadvantage and I do not always want fast results , but why make things harder than they should be.
And as I said before I do not use darks , so skip this if you like ( Calm down everybody I was only joking )

I think you have made a rod for your own back by doing the brilliant blink script  ;)

All hail the Nikolay  :angel: , I am trying hard here , you don't want to see a grown man beg  :(

Regards harry
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 23 13:15:12
Pehaps Juan can make calibrate, align and integrate work with process container ?

Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: NKV on 2010 June 23 15:44:26
calibrate, align and integrate work with process container ?
Process Container is a 'monster' at 99%.
Juan, please add 1% ("save to file" in ImageIntegration module)  ;)

And about External Objects:
Possible to open dialog via script:
Code: [Select]
var p = new ImageIntegration();
p.launchInterface();
We can Run via p.executeGlobal()
But how to enable user to use control elements of External Objects dialogue and wait closing for collect settings from ?
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: RobF2 on 2010 June 24 02:39:55
Sounds like a good plan. You might want to look at MaxIMs calibrate and Stack commands for ideas.
They did a nice job on the worth flow but PI has better processes now.
You did a great job on blink. I think you can handle it!

Max

+1 re Maxim's logical tabbed workflow model (although what you're supposed to do on each tab can be a bit archane)

I understand and agree with what people are saying about unreasonably expecting a masterpiece from full automation, but also suspect many of us are very pleased with the routine settings we use for image cal and alignment - PI is just THAT good at producing a quality end result.  Please remember though I'm talking and thinking as a relative CCD newbie who shoots between 30mins to 4 hrs on most objects.  I'm extremely happy with my QHY9 and PI processing - but would prefer to skip a few of the very repetitive steps early on at all possible.....   >:D

Fascinating discussion....
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 24 06:08:21
Hi all - and really sorry about your original thread being hijacked, Juan :'(

However - the Monster - well, it isn't really a Monster at all - it should just be a way of coordinating all you raw data files, and the processes that you will fine-tune to calibrate these.

In my mind, you would not even 'feed' the Monster in one go. There is nothing against each tab being capable of being 'switched off' for a time. Spread the Monster's meals over several session, making sure that each is fine-tuned (to avoid 'indigestion' - Monster-Barf is truly horrible stuff ::))

As each interim stage is fine-tuned, it gets left alone. The data each stage provides may obviously be used in subsequent stages. Eventually all sub-sections have been fine-tuned, and the top-level images can be created using the "GoForIt" button. But, perhaps as important, is to then be able to save the entire calibration configuration for later re-use.

That is really what we are missing I suppose - a simple (PCL-based) interface that combines II and IC (perhaps along with deBayer and Star Alignment)

What we need to therefore start with is a 'Baby Monster' that is based on ImageCalibration - but where this new SuperCalibration process allows us to ALSO specify the files that will generate the MasterBias and MasterDark frames - along with how these subs should be integrated in order to create the said MasterFrame.

Don't get me wrong - I am PERFECTLY happy with the 'manual method' that I already use - especially now that I can save individually selected ProcessIcons. A key part of my astroimaging pleasure comes from being able to recreate EVERY single step in the processing process, so any interface that makes that easy for me is an advantage.

Cheers,
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: mmirot on 2010 June 24 09:15:59
My work flow currently.
Inspect images remove bad ones including bad flats.

Setup MaxIm DLs calibration by adding new flats for each filter.
MaxIM will allows calbration all image with different filters simultaneously.
This is a huge time saver.
MaxIm automatically makes Masters from the flats. 
Another huge time saver.
I generally have Master Dark and Bias in setup already.
MaxIm will make a new Master Automatically any time you give it a new set  offlats, Bias, darks.
Another huge time saver.

I often process/Calibrate a single image from each filter just a first check.

However after this, There is no reason not process this as a batch.
There are few real options for calbration once it is set up.
Or aleast,  I tend to use the same setting such dark as optimization etc.

Calbration results should not really vary once you find the best settings.

If you want to bang your head on the wall by manual making every master by hand and doing each set at a time go a head.

I can tell my results will be the same as yours unless you make a mistake with pixel math etc.

I can produce well calibrated images in MaxIM in this manner.
 I often do , then use them in PI.

I would use PI Calbration more often if it was more user friendly.
I wound like to try using the overscan feature in PI.
I doubt it will prevent me from a APOD since 30-40 % were processed in MaxIM this way.

Next consider registration. Once you choose a reference frame and elminate frames that won't align you are fine.
It is always the same. No real no settings to mess with.
The software tells you if you can't register a image.
It is fairly binary, it works or not.
PI tells you this and how well your registration did.

What do you want to do each image set one at a time? 
Or perhaps hand star register with 5 stars for 46 images?

There is no reason to not batch these processes. There is nothing to be gained.

Integration is the only step that may require some tweeking.
If your automated work flow saves the aligned images then you change your settings and reintegrate.

My 2 cents.

End of message

Max


Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: varmint on 2010 June 24 14:18:29
especially now that I can save individually selected ProcessIcons.

How do you do this?  Copy/paste the code in the History explorer?

Can you save Process Containers?

I tried looking for answers to this last night and couldn't...  I think I ran into a thread from a year ago that said this wasn't available, but I am not sure.

Thanks,

Jim
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: georg.viehoever on 2010 June 26 08:02:31
Hi Juan,

Enter linear fit clipping:

(http://forum-images.pixinsight.com/II/linear-fit-clipping.png)
...
The remaining question is: is linear fit clipping the best rejection algorithm? I wouldn't say that. Linear fit rejection requires a relatively large set of images to work optimally. With less than 15 images or so its performance may be worse or similar to Winsorized sigma clipping. To reject pixels around a fitted line with low uncertainty, many points are required in order to optimize it in the least average deviation sense. The more images, the better linear fit is possible, and hence the new algorithm will also perform better. It's a matter of testing it and see if it can yield better results than the other rejection algorithms available, for each particular case.
...

I must admit that this method of identifying outliers and the "true value" of a pixel appeared extremely suspicious to me. After all, who says that a distribution without outliers would be well fitted by a linear function after sorting the samples? So I did an experiment with Excel, generating 50 samples with a poisson distribution (as a CCD would do), and adding some polluting signal (a sine) to this that was intended to simulate changing sky conditions such as haze. As can be seen in the attached screenshot or Excel 2007 file, your approach would come close the "true" value of 8000 in both the unpolluted and the polluted case. Quite a surprise for me.

Is there any literature that describes the method? What are known cases where this method produces bad estimates?

Kind regards,
Georg
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: georg.viehoever on 2010 June 27 08:23:55
Hi,

I did some additional research.

(http://forum-images.pixinsight.com/II/linear-fit-clipping.png)

In essence, this image is a Q-Q plot http://en.wikipedia.org/wiki/Q-Q_plot for a uniform distribution http://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29, i.e. when all values generated by the random process (here: CCD values) are equally likely within a certain range, the plot will be similar to a straight line. For distributions where values at the extremes become less likely (e.g. Poisson or normal distribution), the curve will always look more or less like an inverted S.

Basically, finding "outliers" always means that you have some idea how the data should be distributed, and filtering out those that do niot fit under this assumption. I think for CCD data, assuming a Poisson distribution http://en.wikipedia.org/wiki/Poisson_distribution is a valid approach. So to further refine this approach, it may be a good idea to use a Q-Q plot for a poisson distribution instead of one for a uniform distribution.

Just some ideas, not practically tested....

Georg
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Niall Saunders on 2010 June 27 16:01:03
Quote
Quote from: Niall Saunders on June 24, 2010, 15:08:21
especially now that I can save individually selected ProcessIcons.

How do you do this?  Copy/paste the code in the History explorer?

Can you save Process Containers?

I tried looking for answers to this last night and couldn't...  I think I ran into a thread from a year ago that said this wasn't available, but I am not sure.

Thanks,

Jim

Jim - I am moving the reply to your question into the <Tips and Tricks> section

Have a look at http://pixinsight.com/forum/index.php?topic=2025.0 (http://pixinsight.com/forum/index.php?topic=2025.0)

Cheers,
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Emanuele on 2010 August 14 13:14:51
How come I dont have RANSAC Fitting Rejection under ImageIntegration ?

I just have Linear Fit Clipping.....

E.
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegration
Post by: Juan Conejero on 2010 August 15 01:54:27
Hi Emanuele,

I decided to drop RANSAC fitting in favor of the new linear fit clipping rejection algorithm (http://pixinsight.com/forum/index.php?topic=2169.0). Sorry for the confusion I've generated with this post; I'll add a note to inform about this at the top of the thread.
Title: Re: PixInsight 1.6.1 - New RANSAC fitting rejection algorithm in ImageIntegratio
Post by: Emanuele on 2010 August 15 04:49:59
Oh, no worries juan, thank you fir clarifying that. :)