Author Topic: splitting & recombining channels  (Read 13776 times)

Offline lucchett

  • PixInsight Old Hand
  • ****
  • Posts: 449
splitting & recombining channels
« on: 2009 June 02 15:44:13 »
hi,
I wonder if someone could help me in solving this:

I have an rgb image and split the RGB channels.
I get three "grey" files.
If I try to recombine them , PI says it can't because they are grey  images.

Once solved this, the goal is to extract the luminance channel from one rgb, combine it with other luminance data and then make the LRGB.

Many thanks,
Andrea

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: splitting & recombining channels
« Reply #1 on: 2009 June 02 16:27:40 »
Hi,

I've done this a few times and it worked fine although I simply recombined them into RGB after aligning the channels. I did not try LRGB but I assume it's similar. Here is a screenshot of the processes I used. I faked the L channel by copying one of the color channels. Note that I clicked the 'apply global' button on the combine process. I suspect that's the key.

http://gallery.tungstentech.com/main.php?g2_itemId=1489
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: splitting & recombining channels
« Reply #2 on: 2009 June 02 16:32:02 »
hmmm....
I used a color FIT file.
Process | ColorSpaces | ChannelExtraction  gave me 3 grey files (as expected)
Process | ColorSpaces | LRGBCombination  unchecked the L, PI automatically placed the right planes in the right spot (due to the above step and output naming convention) - then I used the "Apply Global" and got the color frame back.
Philip de Louraille

Offline lucchett

  • PixInsight Old Hand
  • ****
  • Posts: 449
Re: splitting & recombining channels
« Reply #3 on: 2009 June 03 02:01:29 »
thanks Philip and Sander,
ok this is fine for RGB split-RGB combine.
What about splitting in HSL or other space and then recombining?

I thought the channel combination process was the right one to use.
I've been able to use it for RGB, duplicating the R channel, making it "RGB" and selecting it as a target in the process.
But still don't know how to recombine in the others color spaces.

Thanks again,
Andrea

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: splitting & recombining channels
« Reply #4 on: 2009 June 03 07:17:05 »
Same stuff really.

Process | ColorSpaces | ChannelExtraction and choose your method (RGB, HSV, HSI, CIR XYZ, ...)
The ChannelCombination will recombine.

I processed the same frame as mentioned above and split it in HSV.
Now I did try an intermediate step on one of the frames, I did a HDRWaveletTransform on the V frame (just to make it different) and then recombined. The output looked quite the same as the original image, I have to say although I did see slight changes in the V frame when the transform was applied.
I then tried to do a PixelMath and subtract the original from the ChannelCombination and PixelMath is telling me that they are "different" types and the operation cannot be done.
Philip de Louraille

Offline Simon Hicks

  • PixInsight Old Hand
  • ****
  • Posts: 333
Re: splitting & recombining channels
« Reply #5 on: 2009 June 03 08:36:26 »
Andrea,

Use LRGBCombine, put the three files in the R, G and B slots and press the blue CIRCLE, NOT the blue triangle. If you press the blue triangle it returns an error saying that it can't do the combination because the three images are grey. I hope that will work.

Cheers
         Simon

Offline lucchett

  • PixInsight Old Hand
  • ****
  • Posts: 449
Re: splitting & recombining channels
« Reply #6 on: 2009 June 04 03:47:09 »
thanks everybody,
this evening my kid won't be around and I'll have the chance to try again :)
Andrea

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: splitting & recombining channels
« Reply #7 on: 2009 June 04 04:43:19 »
A question:

Which of the three channels should we choose to be the reference image when aligning again? I usually use the green channel, because gives me more resolution in DSLR cameras (50% of pixels).

Sergio
Moonfish ED80 over a Meade LX200GPS 8"

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: splitting & recombining channels
« Reply #8 on: 2009 June 04 06:22:45 »
I have to say I am a bit perplexed  by the question. When you split an image with the ChannelExtraction, all the resulting frames are perfectly aligned. Am I missing something?
Philip de Louraille

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: splitting & recombining channels
« Reply #9 on: 2009 June 04 06:53:04 »
I have to say I am a bit perplexed  by the question. When you split an image with the ChannelExtraction, all the resulting frames are perfectly aligned. Am I missing something?

I can say that in my DSLR images, more frecuently when shotting near the horizon, channels are not perfectly aligned. I usually have red arcs only in one side of the stars. When I perform the new alignment, i have complete colour arcs in my stars.

Sergio
Moonfish ED80 over a Meade LX200GPS 8"

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: splitting & recombining channels
« Reply #10 on: 2009 June 04 07:21:42 »
Have you tried the ImageRegistration | StarAlignment step? It will make minor corrections and so correct for geometrical distortions, automatically

I would imagine it could work in your favor here, although your problem is more due to aberration. Let me know if this helps.

Philip de Louraille

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: splitting & recombining channels
« Reply #11 on: 2009 June 04 07:30:30 »
I have extracted channels, StarAligned them and join them again successfully, although minor cromatic aberrations still remained. It makes sense to me.
--
 David Serrano

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: splitting & recombining channels
« Reply #12 on: 2009 June 04 07:47:47 »
Have you tried the ImageRegistration | StarAlignment step? It will make minor corrections and so correct for geometrical distortions, automatically

I would imagine it could work in your favor here, although your problem is more due to aberration. Let me know if this helps.



That's what I do:
-Extract chamnnels
-Staralignment
-LRGB combination.

 :)
Moonfish ED80 over a Meade LX200GPS 8"

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: splitting & recombining channels
« Reply #13 on: 2009 June 04 08:29:25 »
Howdy!

Sorry for not being responsive, but 1.5.2 has all of me right now.

To split channels: ChannelExtraction
To combine channels: ChannelCombination

In general, don't use LRGCombination for this task. This tool is strictly intended to perform LRGB combinations, as its name says. It applies nonlinear transformations which is not what you want.

You can also recombine RGB images using PixelMath, but ChannelCombination is easier.

Note that ChannelCombination can be applied to previews. This means that you can split HSV channels (for example), alter them, then try out the result on a preview (of an image with the same dimensions as the channels; you can either define a preview on the original image or use NewImage to create a new one of the appropriate size).

To split RGB channels, you have a dedicated menu item: Image > Extract > Split RGB Channels, also available on the Image tool bar.

Splitting RGB channels, registering them with StarAlignment and recombining, is in general the best way to fix lateral chromatic aberration. If the aberrations are really wild (so that they can't be described as translation + rotation + scaling), you may consider using DynamicAlignment instead, which allows for arbitrary deformations of any kind.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: splitting & recombining channels
« Reply #14 on: 2009 June 04 08:39:07 »
Hi Sergio

Quote
I can say that in my DSLR images, more frecuently when shotting near the horizon, channels are not perfectly aligned. I usually have red arcs only in one side of the stars. When I perform the new alignment, i have complete colour arcs in my stars.

This is also a typical problem where StarAlignment usually does a nice job. Color misalignment is due to atmospheric color dispersion in this case. This is a vertical displacement (normal to the horizon line) between channels, combined with a scaling effect (actually a vertical chirping effect, especially if the FOV is large). Since this can be described as a homographic transformation, StarAlignment works nicely (at least in all cases I've seen so far).
Juan Conejero
PixInsight Development Team
http://pixinsight.com/