Specifications

Intel
®
Image Processing Library Reference Manual
9-18
9
YCC2RGB
Converts HLS images to
the RGB color model.
void iplYCC2RGB(IplImage*
YCCImage
, IplImage*
rgbImage
);
YCCImage
The source YCC image.
rgbImage
The resultant RGB image.
Discussion
The function converts the YCC image
YCCImage
to the RGB image
rgbImage
; see [Rogers85]. The function checks that the input image is an
YCC image and that the output image is RGB. Both images must be 8-bit
unsigned.
Using Color-Twist Matrices
One of the methods of color model conversion is using a color-twist
matrix. The color-twist matrix is a generalized 4 by 4 matrix [t
i,j
] that
converts the three channels (a, b, c) into (d, e, f) according to the following
matrix multiplication by a color-twist matrix (the superscript
T is used to
indicate the transpose of the matrix).
[d, e, f, 1]
T
= t11 t12 t13 t14 * [a, b, c, 1]
T
t21 t22 t23 t24
t31 t32 t33 t34
000t44
To apply a color-twist matrix to an image, use the function
iplApplyColorTwist(). But first call the iplCreateColorTwist() and
iplSetColorTwist()functions to create the data structure
IplColorTwist. This data structure contains the color-twist matrix and
allows you to store the data internally in a form that is efficient for
computation.