Specifications
Image Creation and Access
4-41
4
ScaleFP
Converts the image data to
and from floating-point type
by scaling.
IPLStatus iplScaleFP (const IplImage*
src,
IplImage*
dst,
float
minVal,
float
maxVal
);
srcImage
Thesourceimage.
dstImage
The resultant image.
minVal, maxVal
The floating-point data range (
minVal
<
maxVal
).
Discussion
The function iplScaleFP() converts the data of the input image
src
to
the data type of the output image
dst
by scaling. One of the images must
contain data of 32-bit floating-point type; the other image’s bit depth can
be 8-bit per channel (signed or unsigned), 16 bit per channel (signed or
unsigned), or 32-bit signed.
If the input image data is 32-bit floating-point, the function linearly maps
the user-defined floating-point data range [
minVal
..
maxVal
] onto the
whole range of the output data type, [
dst_type_min
..
dst_type_max
]. If
some of the input floating-point values are outside the specified input data
range [
minVal
..
maxVal
], the corresponding output values will saturate.
(To determine the actual floating-point data range in your image, use the
function
iplMinMaxFP.)
If the output image data is 32-bit floating-point, the function linearly maps
the whole range of the intput data type [
src_type_min
..
src_type_max
]
onto the user-defined floating-point data range [
minVal
..
maxVal
].
Return Value
If the execution is successful, the function returns IPL_StsOK;otherwise,it
returns an error status code.