Specifications

Color Space Conversion
9-7
9
Conversion from Bitonal to Gray Scale Images
This section describes the function that performs the conversion of bitonal
images to gray scale.
BitonalToGray
Converts a bitonal
image to gray scale.
void iplBitonalToGray(IplImage*
srcImage
, IplImage*
dstImage
, int
ZeroScale
, int
OneScale
);
srcImage
The bitonal source image.
dstImage
The resultant gray scale image. (See the
discussion below.)
ZeroScale
The value that zero pixels of the source image
should have in the resultant image.
OneScale
The value given to a resultant pixel if the
corresponding input pixel is 1.
Discussion
The function iplBitonalToGray() converts the input 1-bit bitonal image
srcImage
to an 8s, 8u, 16s or16u gray scale image
dstImage
.
If an input pixel is 0, the corresponding output pixel is set to
ZeroScale
.
If an input pixel is 1, the corresponding output pixel is set to
OneScale
.
Conversion of Absolute Colors to and from Palette Colors
Since the IplImage format supports only absolute color images, this
functionality is provided only within the context of converting an absolute
color image
IplImage to and from a palette color DIB image. See the
section “Working in the Windows DIB Environment” in Chapter 4.