Specifications
Geometric Transforms
11-7
11
Resize
Resizes an image.
void iplResize(IplImage*
srcImage
, IplImage*
dstImage
, int
xDst
, int
xSrc
, int
yDst
, int
ySrc
, int
interpolate
);
srcImage
The source image.
dstImage
The resultant image.
xDst,xSrc,yDst,ySrc
Positive integers specifying the fractions
xDst/xSrc
and
yDst/ySrc
- the factors by
which the x and y dimensions of the image’s ROI
are changed. For example, setting
xDst
=1,
xSrc
=2,
yDst
=2,
ySrc
=1
halves the x and doubles the y dimension.
interpolate
The type of interpolation to perform for
resampling. Can be one of the following:
IPL_INTER_NN Nearest neighbor.
IPL_INTER_LINEAR Linear interpolation.
IPL_INTER_CUBIC Cubic interpolation.
IPL_INTER_SUPER Super-sampling (can be
used only for
xDst
≤
xSrc
,
yDst
≤
ySrc
).
Discussion
The function iplResize() resizes the source image
srcImage
by
xDst/xSrc
in the x direction and
yDst/ySrc
in the y direction.
The function differs from
iplZoom and iplDecimate in that it can
increase one dimension of an image while decreasing the other dimension.
The interpolation specified by
interpolate
is used for resampling the
input image.