Author Topic: Confusion on application of Luminance in RGB image  (Read 6007 times)

Offline LD

  • PixInsight Enthusiast
  • **
  • Posts: 86
Confusion on application of Luminance in RGB image
« on: 2009 November 07 06:49:42 »
Hi All,
I have just begun to play with one-shot images (was trying Georg's "challenge" data) which brought up some questions, mostly regarding two processes:

In ACDNR, what is the purpose of using Luminance? Wouldn't an image be all Chrominance if it is merely RGB data? Or is there a simulated Luminance layer as well that is automatically generated or just inherent in all images?

Same question on Masks. I recall in many tutorials or other posts, it suggests first extracting a Luminance image, then making a mask of that. Is that the proper way to go versus making a mask of the entire RGB image? Or does it make any difference? I'm wondering if this had something to do with my System Exception yesterday while applying an inverted mask made from the full data (see bug reports from yesterday http://pixinsight.com/forum/index.php?topic=1481.0

I know I give away my ignorance on these questions :-[ but I guess I don't understand the role of Luminance versus Chrominance in general when dealing with a strictly RGB image from a one-shot camera (unless I go ahead and make a Luminance out of those three channels).

Thanks for clearing up my confusion. When I did mostly LRGB images from filters, the use of the Luminance channel was much more intuitive to me.

Larry

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Confusion on application of Luminance in RGB image
« Reply #1 on: 2009 November 07 07:40:03 »
Larry,

Luminance is simply the brightness of an image. Without brightness you wouldn't see anything. Luminance is calculated from RGB using color space related formulas. Juan can explain this better than I can. The important thing is that black has luminance 0 and white has luminance 1.

The reason you use a luminance mask for ACDNR is that in this business brighter areas typically have better SNR so you want less noise reduction.

I see it's possible to apply an RGB image as a mask, to be honest I didn't know that was possible. Use the type of mask that fits your application. I would think that an RGB mask applies each channel separately (Red on Red etc.).
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 Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Confusion on application of Luminance in RGB image
« Reply #2 on: 2009 November 07 07:58:06 »
Forget for a moment the acquisition.

Now you have a RGB image. This means, there are three coordinate values, each indicating a intensity for a given color. This is what is called a color space. You may think as each RGB channel as orthogonal coordinates, and every "color" is inside a square of 1 each side (for a normalized range). Ok. But, you may remember the old black and white televisions, or your vision at night. You don't see colors, just grayscale intensities. How is translated a 3 dimensional value, the color, into a single dimension value, grayscale?  You have to take proportions of each RGB value. In the cube, RGB color space, this is a straight line that runs across the cube in some way.
Right now we have a way to define the luminance of any image. What is the chrominance? Remember the cube. Any "color" may be described as 3 independent R, G and B values. If we know the luminance associated to that color, and take that information as a new coordinate, we only need 2 other coordinates to reach the original point. Think about vectors. The chrominance is what is missing to the luminance to become a "color". It is just the information of the hue and saturation. In fact, this is a way to establish the chrominance coodinates: Hue is the angle around the luminance; where to point, and saturation is how far from the luminance line it lyes. There are many more ways to set those values, and hence are the variety of color spaces: Lab, Lch... and different ways to set the "luminance value": HSV, HSI, etc.

So, this has nothing to do with the capture method. If you capture L, R, G and B data, you are replacing the luminance from the RGB filters with the captured luminance. The idea behind this method is that the human eye is not as good to discriminate chrominance values than luminance, and for this you may use 2x2 binning for RGB data, and use it's chrominance to complement the captured luminance.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Confusion on application of Luminance in RGB image
« Reply #3 on: 2009 November 07 08:28:16 »
That's the best explanation I've read on this subject yet Carlos. Many thanks!
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 LD

  • PixInsight Enthusiast
  • **
  • Posts: 86
Re: Confusion on application of Luminance in RGB image
« Reply #4 on: 2009 November 07 11:23:19 »
Carlos and Sander,
One of the great things about this hobby is the constant learning in so many directions, and this forum always provides one heck of an education at every level (even mine ;).)
Thank you both for the excellent explanations.
Larry

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: Confusion on application of Luminance in RGB image
« Reply #5 on: 2009 November 08 03:04:11 »
[Luminance]In the cube, RGB color space, this is a straight line that runs across the cube in some way.
Great explanation! Could we say that the luminance is the modulus of the vector (0, 0, 0) -> (R, G, B)? (I guess that it would get a little more complicated if we take into account the luminance coefficients of the RGB working space).

Right now we have a way to define the luminance of any image. What is the chrominance? Remember the cube. Any "color" may be described as 3 independent R, G and B values. If we know the luminance associated to that color, and take that information as a new coordinate,
Now I'm getting lost. If we take the luminance as a new coordinate, do we now have a 4-dimensional space?

we only need 2 other coordinates to reach the original point.
I must be getting it backwards. After taking the luminance as a new coordinate, we must be ending up with a 2-dimensional space, not 4. But I don't see how.
--
 David Serrano

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Confusion on application of Luminance in RGB image
« Reply #6 on: 2009 November 08 08:17:27 »
Hi David

No, it is not the modulus. It is the proyection into the predefined straigt line. A point product with the vector, for example (can't remember the standard luminance factors): (0.15, 0.68, 0.17)
I think that the modulus is not used in any color space (at least, those I'm aware of). I (HSI) seems to be the proyection to the diagonal, while V is the maximum value.

Quote
Now I'm getting lost. If we take the luminance as a new coordinate, do we now have a 4-dimensional space?

No, we are defining a new set of coordinates for a color space, being the luminance the first of them. [Math warning: You cannot have a 4d space with the luminance, because it is not linearly independent ;) ]. So, what is left is to define the other two coordinates, that moves along a plane perpendicular to the luminance, witch corresponds to the chrominance.

To see more clearly how the chrominance coordinates work, it is commonly used to transform the cube into a cylinder. The vertical axis is the luminance. Radial distance is the saturation, and rotation angle the hue.

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com