Specifications
Geometric Transforms
11-9
11
Example 11-1 Using Macro Definition to Resize an Image
int ResizeFit( void ) {
IplImage *imga = iplCreateImageJaehne(
IPL_DEPTH_8U, 5, 5 );
IplImage *imgb = iplCreateImageJaehne(
IPL_DEPTH_8U, 7, 7 );
IPLStatus st;
iplResizeFit( imga, imgb, IPL_INTER_NN );
st = iplGetErrStatus();
iplDeallocate( imga, IPL_IMAGE_ALL );
iplDeallocate( imgb, IPL_IMAGE_ALL );
return IPL_StsOk == st;
}
Changing the Image Orientation
The functions described in this section change the image orientation by
rotating or mirroring the source image. Rotation involves image resampling
by using various kinds of interpolation: nearest neighbor, linear, or cubic
interpolation (see Appendix B). Mirroring is performed by flipping the
image axis in horizontal or vertical direction.
Rotate
Rotates an image
around the (0,0) origin.
void iplRotate(IplImage*
srcImage
, IplImage*
dstImage
,
double
angle
, double
xShift
, double
yShift,
int
interpolate
);
srcImage
Thesourceimage.