![background image](http://html.mh-extra.com/html/national-instruments-corporation/imaq-pci-1408/imaq-pci-1408_getting-started_710256077.webp)
Appendix B
StillColor
©
National Instruments Corporation
B-9
PCI/PXI-1408 and NI-IMAQ for Win95/NT
Hue, Saturation, Luminance, and Intensity Planes
The hue, saturation, luminance, and intensity planes can also be
returned individually if you want to analyze the image. You can retrieve
the data in 8-bit format to reduce the amount of data to be processed or
in 16-bit format to take advantage of the higher precision available
when using averaging.
The 16-bit image representation is scaled so that the pixel values are
always positive. The value range is 0 to +32,767, so it is compatible
with both 16-bit signed and 16-bit unsigned integers. On average, the
16-bit representation of a plane is equal to 128 times the 8-bit
representation of the plane from the same image. The 16-bit
representation is generally only used if you are performing averaging on
your image. For example, averaging an image 16 times requires four
extra bits (16 =
) to represent the increased dynamic range. In this
case, using the 16-bit representation may increase the dynamic range of
your image.
Luminance, Intensity, Hue, or Saturation are defined using the Red,
Green, and Blue values in the following formulas:
Luminance = 0.299
×
Red + 0.587
×
Green + 0.114
×
Blue
Intensity = (Red + Green + Blue) / 3
Hue = ATN2 (Y, X)
where
Y = (Green - Blue) /
and
X = (2
×
Red - Green - Blue) /
Saturation =
where
Y = (Green - Blue) /
and
X = (2
×
Red - Green - Blue) /
32-Bit HSL and HSI
You can also pack the three 8-bit Hue, Saturation, and Luminance
planes (HSL) or the three Hue, Saturation, and Intensity planes (HSI) in
one array of 32-bit integers, which is equivalent to the 32-bit RGB
representation.
2
4
2
6
X
2
Y
2
×
2
6