Specifications

Color Space Conversion
9-15
9
RGB2XYZ
Converts RGB images
to the XYZ color model.
void iplRGB2XYZ(IplImage*
rgbImage
, IplImage*
xyzImage
);
rgbImage
ThesourceRGBimage.
xyzImage
The resultant XYZ image.
Discussion
The function converts the RGB image
rgbImage
to the XYZ image
xyzImage
according to the following formulas:
X = 0.4124
·R + 0.3576·G + 0.1805·B
Y = 0.2126
·R + 0.7151·G + 0.0721·B
Z = 0.0193
·R + 0.1192·G + 0.9505·B.
The function checks that the input image is an RGB image; it sets the
channel sequence and color model of the output image to XYZ.
Since 0.0193 + 0.1192 + 0.9505 > 1,
the Z value might saturate.
XYZ2RGB
Converts XYZ images to
the RGB color model.
void iplXYZ2RGB(IplImage*
xyzImage
, IplImage*
rgbImage
);
xyzImage
The source XYZ image.
rgbImage
The resultant RGB image.
Discussion
The function converts the XYZ image
xyzImage
to the RGB image
rgbImage
. The function checks that the input image is an XYZ image and
that the output image is RGB.