Author Topic: HaRGBCombination Script  (Read 99178 times)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #120 on: 2013 September 21 13:07:35 »
Hmm, Peter, I'll check again the code tonight.
BTW, no matter what the preview does, is the final result correct?
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline topboxman

  • PixInsight Addict
  • ***
  • Posts: 292
    • Peter's Gallery
Re: HaRGBCombination Script
« Reply #121 on: 2013 September 21 13:24:55 »
The final result looks pretty good but I cannot tweak the changes because it does not appear to change in the preview. For example setting a Multiplier of 1.2 and 10.0 didn't make any difference. What I have not yet done is save both images of different settings to see if both images are different. Will get back to you later about this.

Peter

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #122 on: 2013 September 21 13:28:58 »
Checking as we post. So far I can not see anything strange on the code, but I'll check more and see if there is a bug somewhere.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline topboxman

  • PixInsight Addict
  • ***
  • Posts: 292
    • Peter's Gallery
Re: HaRGBCombination Script
« Reply #123 on: 2013 September 21 13:47:57 »
I think it's okay. I was working in my room with the shades open and my room was bright. So I closed the shades and turned off the lights and noticed the change using Multiplier of 1.2 and 10. I am seeing same effects for both scripts. The bright room made it difficult to notice the change.

Sorry about the false alarm.

Peter

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #124 on: 2013 September 21 14:47:23 »
No problem. It made me look again back in the script, and maybe I found another bug (not related).
Also maybe I can spend some time to start the changes Juan mentioned.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline topboxman

  • PixInsight Addict
  • ***
  • Posts: 292
    • Peter's Gallery
Re: HaRGBCombination Script
« Reply #125 on: 2013 September 21 16:02:58 »
Thank you for your contribution for finishing this script.

Peter

Offline mattssporre

  • Newcomer
  • Posts: 20
    • Spur Photography
Re: HaRGBCombination Script
« Reply #126 on: 2013 October 16 23:49:13 »
Quote
Originally Silvercap implemented the "Vicent method" with these PixelMaths (free form):

Ha <- (Ha*RGB_bandwidth-RGB*Ha_bandwidth )/(RGB_bandwidth-Ha_bandwidth) -  hmm , take out the stars ?   

R <- R+(Ha-med(Ha))*HaMultiplier - not sure but, take out the nebula ? Leave only stars ?  Continuum ?

Ha <- LinearFit(Ha with R)

R <- max(Ha,R)

Is this really Vicent's method? Looking into the script I miss several components (but when I learned programming object oriented programming was not standard so it makes me unoriented  :)).

1. I do not see the creation of the continuum map (C = R/H in the case of Ha addition to the R channel)
2. I do not see any denoising of C
3. I do not see any creation of the attenuated R (or R flat fielded by Ha)

I would expect something like this (sorry for the crude programming syntax)

Repeat until "satisfied"
   Normalize(H to R);
   C = R/H;
   C = denoise(C);
   R = C*H;
end;

As far as I can see none of these steps are in the script, but it might be hidden to my eyes among all the "this.object.var()" stuff?

Moreover Vicent's method should also handle the difference in star sizes by creating a (k*Ha)GB image (swap the R channel with k*Ha where k is supplied by the user), use the Lum of this k*HaGB image in combination with the chrominiance info (a and b channels) from the HaRGB image created in the loop above.

I cannot see that either in the script  :surprised:

What I can see though is a max(R,H) - so is this really a (max(R,H))GB script, in combination with smart re-scaling (or star handling) of H and R (the two first math expressions in the quote above)?

The final possibility is that I am the one in need of denoising  :o

BR
Matts

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #127 on: 2013 October 17 01:39:13 »
Well, I think you are right. I always had doubts about the maths used. Original the discussion started from this thread (and others before it) http://pixinsight.com/forum/index.php?topic=3401.0 were you can see Silvercap's comments:

Quote
The script do a linear fit between Red and Ha, then do the Vicent Peris pixelmath's with a little diference, in a third step the script do a max between original Ha  and recombined HaR. Yes, I add Ha to Red.

And you are right, it does not have the denoise, neither the repeated process that Vicent mentioned. But - frankly- I do not think that there is a final method, everything is under investigation. Meanwhile this script does a decent job.

BTW all the job is done from the line that says

Code: [Select]
this.Calculate_NBRGB = function() {
up to the line that says (excluded) :

Code: [Select]
this.showNBRGB = function() {
all the pixelmaths are there (I'm not giving line numbers because the version I have on my laptop is heavily modified - when I have free time I'm trying to clean it up and improve it).

Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline mattssporre

  • Newcomer
  • Posts: 20
    • Spur Photography
Re: HaRGBCombination Script
« Reply #128 on: 2013 October 17 01:51:58 »
Thanks for answering Ioannis,

I agree the script does a good job, but I notice changes in star color. If I only add Ha to the red channel the star color changes are subtle but they are there. If I do a "full add", ie also O3 and S2 data the star colors def change (could also be due the ambiguity with how to add O3 and S2 data).

One of the "promises" of Vicents method was to preserve star color (as well as star brightness) so that is why I am trying to understand it.

BR
Matts
PS thanks for modifying this script it is def easier than "fooling" the HaRGBCombination script by swapping channels :D

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #129 on: 2013 October 17 02:39:12 »
One of the "promises" of Vicents method was to preserve star color (as well as star brightness) so that is why I am trying to understand it.

Of course you realize that all these are tabula rasa and we just playing with them.
As I understand "Vicent's method" is still under investigation.
This script is better described as "Silvercup's method" ;)
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: HaRGBCombination Script
« Reply #130 on: 2013 November 26 01:31:23 »
Hello to everyone,

Business and personal issues kept me out of the hobby for long, but recently I had a bit of free time. I tried to process a few of the images I got during summer holidays ( :sad: ) , which of course reminded me that I have neglected this script.

So, here it is , version 1.6. Please test for bugs (none that I know  ;) )
Mainly cosmetics and code cleanup, trying to address (most of) Juan's recommendations.
Installation as usual, ie save/extract to your favorite folder, Script -> Future Scripts -> Add (your folder) and then you will find it in Scripts -> Utilities
 
Juan, take a look please, I think it may be ready for 1.8.
« Last Edit: 2013 November 26 06:44:46 by Ioannis Ioannou »
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 988
    • http://www.astrofoto.es/
Re: HaRGBCombination Script
« Reply #131 on: 2013 November 26 10:12:18 »
As I understand "Vicent's method" is still under investigation.

Vicent's method does not exist. In the Munich workshop I showed 7 different approeaches to HaRGB combination. Image processing is all about improvisation with good fundamental knowledge and a good eye to see what's happening in the image.


V.

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: HaRGBCombination Script
« Reply #132 on: 2013 November 26 12:12:17 »
Hi Vicent

I believe this script was originally based on the Method you kindly shared with me a few years ago

So its all "yours"   8)

Harry
Harry Page

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: HaRGBCombination Script
« Reply #133 on: 2013 November 26 12:38:53 »
Hi

I have had a quick go with some Ha and RGB ( all I have ) and it seemed to work very well  :-* and looks tidy

See what others think

Harry
Harry Page

Offline chris.bailey

  • PixInsight Addict
  • ***
  • Posts: 235
Re: HaRGBCombination Script
« Reply #134 on: 2013 November 26 13:07:07 »
We all know whose method it was  ;D

Yep, seems to work very well!