Specifications

Intel
®
Image Processing Library Reference Manual
9-16
9
RGB2YCrCb
Converts RGB images to
the YCrCb color model.
void iplRGB2YCrCb(IplImage*
rgbImage
, IplImage*
YCrCbImage
);
rgbImage
ThesourceRGBimage.
YCrCbImage
The resultant YCrCb image.
Discussion
The function converts the RGB image
rgbImage
to the YCrCb image
YCrCbImage
(via the YUV model) according to the following formulas:
Y =0.3
·R + 0.6·G + 0.1·B
U = B
-
YCb=0.5·(U+1)
V = R
-
YCr= V/1.6 + 0.5.
The function checks that the input image is an RGB image; it sets the
channel sequence and color model of the output image to “YCr”.
YCrCb2RGB
Converts YCrCb images
to the RGB color model.
void iplYCrCb2RGB(IplImage*
YCrCbImage
, IplImage*
rgbImage
);
YCrCbImage
The source YCrCb image.
rgbImage
The resultant RGB image.
Discussion
The function converts the YCrCb image
YCrCbImage
to the RGB image
rgbImage
. The function checks that the input image is a YCrCb image and
that the output image is RGB.