Specifications

Geometric Transforms
11-21
11
Discussion
The functions iplWarpBilinear() and iplWarpBilinearQ() warp the
source image by a bilinear transformation according to the following
formulas:
x = c
00
·xy + c
01
·x + c
02
·y + c
03
y = c
10
·xy + c
11
·x + c
12
·y + c
13
where x and y denote the original pixel coordinates; x and y denote the
pixel coordinates in the transformed image.
The two functions differ in their third argument:
iplWarpBilinear() uses
a 2-by-4 input array of transform coefficients c
mn
=
coeff
[m][n],
whereas iplWarpBilinearQ() computes the coefficients internally from
the input array
quad
containing coordinates of the reference quadrangle.
If
warpFlag
is IPL_R_TO_Q, the functions transform the rectangular ROI
of the source image into the reference quadrangle of the resultant image.
If
warpFlag
is IPL_Q_TO_R, the functions transform the source quadrangle
into the rectangular ROI of the resultant image.
The interpolation specified by
interpolate
is used for resampling the
input image.
To compute the bilinear transform parameters, use the auxiliary functions:
iplGetBilinearBound(), iplGetBilinearQuad() and
iplGetBilinearTransform(). These functions are described in the
sections that follow.