Graphics Reference
In-Depth Information
Image A
Image B
Image A with grid points and curves defined
Image B with grid points and curves defined
FIGURE 4.42
Sample grid definitions.
1.0) along the way from the source image to the
destination image, the vertices (points of intersection of the curves) of the source and destination grids
are interpolated to form an intermediate grid. This interpolation can be done linearly, or grids from
adjacent key frames can be used to perform higher-order interpolation. Pixels from the source and des-
tination images are stretched and compressed according to the intermediate grid so that warped ver-
sions of both the source image and the destination grid are generated. A two-pass procedure is used
to accomplish this (described in the following section). A cross-dissolve is then performed on a
pixel-by-pixel basis between the two warped images to generate the final image (see Figure 4.43 ) .
For purposes of explaining the two-pass procedure, it will be assumed that it is the source image to
be warped to the intermediate grid, but the same procedure is used to warp the destination image to the
intermediate grid.
First, the pixels from the source image are stretched and compressed in the x -direction to fit the
interpolated grid. These pixels are then stretched and compressed in the y -direction to fit the interme-
diate grid. To carry this out, an auxiliary grid is computed that, for each grid point, uses the y -coordinate
from the corresponding grid point of the source image grid and the x -coordinate from the corresponding
point of the intermediate grid. The source image is stretched/compressed in x by mapping it to the aux-
iliary grid, and then the auxiliary grid is used to stretch/compress pixels in y to map them to the inter-
mediate grid. In the following discussion, it is assumed the curves are numbered left to right and bottom
to top; a curve's number is referred to as its index .
Figure 4.44 illustrates the formation of the auxiliary grid from the source image grid and the inter-
mediate grid. Once the auxiliary grid is defined, the first pass uses the source image and auxiliary grids
to distort the source pixels in the x -direction. For each row of grid points in both the source and the
To generate an intermediate image, say t (0
<t<
 
Search WWH ::




Custom Search