Specifications

Intel
®
Image Processing Library Reference Manual
9-10
9
Table 9-4 Source and Resultant Image Data Types for Conversion from Gray
Scale to Color
Source Image (data type) Resultant image (data type)
Gray scale 1 bit 8 bit per channel
Gray scale 8 bit 8 bit per channel
Gray scale 16 bit 16 bit per channel
Gray scale 32 bit 32 bit per channel
The equations for chrominance in RGB from luminance Y are:
R =
FractR
*Y; 0<=
FractR
<= 1
G =
FractG
*Y; 0<=
FractG
<= 1
B =
FractB
*Y; 0<=
FractB
<= 1.
If all three values
FractR
,
FractG
,
FractB
are zero, then the default
values are used in above equations so that:
R = 0.212671 * Y, G = 0.715160 * Y, B = 0.072169 * Y.
Conversion of Color Models
This section describes the conversion of red-green-blue (RGB) images to
and from other common color models: hue-saturation-value model (HSV),
hue-lightness-saturation (HLS) model, and a number of others.
As an alternative way of color models conversion (that works only for
some color models) you can just multiply pixel values by a color twist
matrix; see “Color Twist Matrices” section in this chapter.
Note also that conversion of RGB images to and from the cyan-magenta-
yellow (CMY) model can be performed by a simple subtraction. You can
use the function
iplSubtractS to accomplish this conversion. For
example, with maximum pixel value of 255 for 8-bit unsigned images,
the
iplSubtractS() function is used as follows:
iplSubtractS(
rgbImage
,
cmyImage
, 255, TRUE)