Specifications
Intel
®
Image Processing Library Reference Manual
4-40
4
Scale
Scales the image data.
IPLStatus iplScale (const IplImage*
src,
IplImage*
dst
);
src
Thesourceimage.
dst
The resultant image with data of a different type.
Discussion
The function iplScale() converts the data of the input image
src
to the
data type of the output image
dst
.
Unlike
iplConvert(),whichsaturates the converted data as necessary,
iplScale() scales the data, using a linear mapping of the whole range of
the input data type onto the range of the output data type:
output value = A + B * input value.
Here A and B are such that the minimum and maximum presentable values
of the input data type (
src_type_min
and
src_type_max
) are mapped,
respectively, to the minimum and maximum presentable values of the
output data type (
dst_type_min
and
dst_type_max
):
B =(
dst_type_max
–
dst_type_min
)/(
src_type_max
–
src_type_min
)
A =
dst_type_min
– B *
src_type_min
.
The input and output images must have the same data ordering and
coordinate origins. The data types in
src
and
dst
must be different. The
supported data types for input and output images are 8-bit per channel
(signed or unsigned), 16 bit per channel (signed or unsigned), or 32-bit
signed. (For converting image data to and from 32-bit floating-point data
type, use the function
iplScaleFP.)
Return Value
If the execution is successful, the function returns IPL_StsOK;otherwise,it
returns an error status code.