Specifications
Geometric Transforms
11-15
11
Warping
This section describes shearing and warping functions of the Image
Processing Library. These functions have been added in release 2.0.
They perform the following operations:
• affine warping (the functions
iplWarpAffine and iplShear)
• bilinear warping (
iplWarpBilinear, iplWarpBilinearQ)
• perspective warping (
iplWarpPerspective, iplWarpPerspectiveQ).
Affine warping operations are more complex and more general than
resizing or rotation. A single call to
iplWarpAffine() can perform a
rotation, resizing, and mirroring. (This can require some matrix math on
the part of the user to calculate the transform coefficients.)
Bilinear and perspective warping operations can be viewed as further
generalizations of affine warping. They give you even more degrees of
freedom in transforming the image. For example, an affine transformation
always maps parallel lines to parallel lines, while bilinear and perspective
transformations might not preserve parallelism; a bilinear transformation
might even map straight lines to curves.
Unlike rotation or zooming, the warping functions do not necessarily map
the rectangular ROI of the source image to a rectangle in the destination
image. Affine warping functions map the rectangular ROI to a
parallelogram; bilinear and perspective warping functions map the ROI to a
general quadrangle.
To help you cope with the complex behavior of warping transformations,
the library includes a number of auxiliary functions that compute the
following warping parameters:
• coordinates of the four points to which the ROI’s vertices are mapped
• the bounding rectangle for the transformed ROI
• the transformation coefficients.
These auxiliary functions are described immediately after the function that
performs the respective warping operation.