Appendix A
Introduction to Color
©
National Instruments Corporation
A-3
Hue, Saturation, Luminance, and Intensity Planes
The NI 1405 can return an 8-bit Luminance (L) plane, but not Hue (H) or
Saturation (S) planes. You can use the NI Vision Development Module or
Vision Builder AI to convert the RGB data from the NI 1405 to HSL or
Hue, Saturation, and Intensity (HSI) planes.
Luminance, intensity, hue, and 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 =
32-Bit HSL and HSI
You can also pack the three 8-bit HSL planes or the three HSI planes
in one array of 32-bit integers, which is equivalent to the 32-bit RGB
representation.
2
6
255
1 3
Min R G B
, ,
(
)
×
R G B
+
+
------------------------------------------
–
⎝
⎠
⎛
⎞
×