Specifications

Color Space Conversion
9-17
9
RGB2YUV
Converts RGB images
to the YUV color model.
void iplRGB2YUV(IplImage*
rgbImage
, IplImage*
yuvImage
);
rgbImage
ThesourceRGBimage.
yuvImage
The resultant YUV image.
Discussion
The function converts the RGB image
rgbImage
to the YUV image
yuvImage
according to the following formulas:
Y =0.3
·R + 0.6·G + 0.1·B
U = B
-
Y
V = R
-
Y.
The function checks that the input image is an RGB image; it sets the
channel sequence and color model of the output image to YUV.
YUV2RGB
Converts YUV images to
the RGB color model.
void iplYUV2RGB(IplImage*
yuvImage
, IplImage*
rgbImage
);
yuvImage
The source YUV image.
rgbImage
The resultant RGB image.
Discussion
The function converts the YUV image
yuvImage
to the RGB image
yuvImage
. The function checks that the input image is an YUV image and
that the output image is RGB.