You are on page 1of 30

IMAGE MORPHING

Lc Thin Tn - 1112277
L Duy Thanh 1112282
Nguyn Dng Thu - 1112303
GVHD: L Quc Ngc
I. Introduction
II. Algorithms
Mesh Warping
Triangular Mesh
- Affine Transformation
Quadrangular Mesh
- Bilinear Transformation
Feature-Based
What is image morphing?
Morphing is turning one image into another .
First movies with morphing
- Willow, 1988
- Indiana Jones and the Last Crusade, 1989
First music video with morphing
- Black or White, Michael Jackson,1991
Video
HOW IS MORPHING ?
General Idea
As the metamorphosis process ,
- The first image is gradually distorted and is faded out.
- The second image starts out totally distorted
toward the first and is faded in.
Steps Involved:
Morphing = warping + cross-dissolving
shape
(geometric)
color
(photometric)
Warp = feature point + warp image base on feature point
WARPING
A warp is a 2-D geometric transformation and generates a
distorted image when it is applied to an image.
Warping an image means : for every time, you must find
the average shape.
Two ways to warp an image:
Forward mapping.
Reverse mapping.
Forward Mapping
Each pixel in source image is mapped to an appropriate pixel
in destination image.
Some pixels in the destination image may not be mapped.
Reverse Mapping
This method goes through each pixel in the
destination image and samples an appropriate source
image pixel.
All destination image pixels are mapped to some
source image pixel.
Forward Mapping and Reverse Mapping at t
source image destination image Forward Mapping Reverse Mapping
II. Algorithms
Mesh Warping
Triangular Mesh
- Affine Transformation
Quadrangular Mesh
- Bilinear Transformation
Feature-Based
Mesh Base
The mesh-warping algorithm relates features with non-uniform mesh in the
source and destination images.
The algorithm accepts a source image, a destination image and two 2D arrays of
coordinates. The first array specifies the coordinates of control points in the
source image. The second array specifies their corresponding positions in the
destination image. Both must have the same dimensions in order to establish a
one-to-one correspondence.
THE MORPHING PROCESS
Step I: Determination feature points
Step II: Divide each photo into non-overlappings triangular or
quadrangular regions
Step III: Warping the Images
Each of the source images has to be deformed towards the
needed frame.
The deformation works pixel by pixel is based on the
reverse mapping. This algorithm is called Affine Transformation
Step VI: Cross-dissolve sources image and result image
Mesh Warping
Triangular Mesh
o Fist, Specify corresponding points.
- Interpolate to a complete warping function.
o Second, Determination feature points and divide each photo into non-
overlappings triangular.
Divide image
source image destination image
Affine Transformation
Suppose we have two triangles ABC and DEF. An affine transformation is a linear mapping from one
triangle to another. For every pixel p within triangle ABC, assume the position of p is a linear
combination of A, B, and C vectors. The transformation is given by the following equations
Here, there are two unknowns, Lambda1 and Lambda2, and two equations for each of the two
dimensions. Consequently, Lambda1 and Lambda2 can be solved, and they are used to obtain, the affine
transformation is a one-to-one mapping between two triangles.
Quadrangular Mesh
o Determination feature points and divide each photo into non-overlappings
quadrangular regions
source image destination image
o Specify corresponding spline control points
- Interpolate to a complete warping function
Two 2D arrays of coordinates
Bilinear Transformation
Suppose we have two quadrangles ABCD and EFGH. The Bilinear transformation is a
mapping from one quadrangle to another. For every pixel p within quadrangle ABCD, assume
that the position of p is a linear combination of vectors A, B, C, and D. Bilinear
transformation is given by the following equations
o Warping transformation partially defined by user interactively
specifying corresponding pairs of vectors in the source and
destination images; only a sparse set is required (but carefully
chosen)
o Compute dense pixel correspondences, defining continuous
mapping function, based on weighted combination of displacement
vectors of a pixel from all of the input vectors.
o Interpolate pixel positions and colors (2D linear interpolation)
Feature-Based
Specify corresponding line segments (vectors).
- Interpolate to a complete warping function.
o Consider images where there is one line segment pair, and it is translated
from image A to image B:
o First, linearly interpolate position of line segment in M
o Second, for each pixel (x, y) in M, find corresponding pixels in A(x-a, y)
and B(x+a, y), and average them
o A pair of lines (one defined relative to the source image, the other defined
relative to the destination image) defines a mapping from one image to the
other.
source image destination image
u is the position along the line, and v is the distance from the line.
Transformation between one pair of lines
u =
p
b
-q
b
(
b
-q
b
)
||
b
-q
b
||
2
v =
p
b
-q
b
PcpcndcuIu(
b
-q
b
)
||
b
-q
b
||

p
b
= q
u
+u r
u
q
u
+
: PcrpcnJiculor(r
u
q
u
)
||r
u
q
u
||
o The algorithms transforms each pixel coordinate by a rotation, translation, and
a scale, thereby transforming the whole image.
Transformation between multiple pairs of lines
o There are many features in images where transformation between multiple pairs
of lines are applied. It specifies more complex transformations. A weighting of
the coordinate transformations for each line is performed. The weight is
determined by the distance from X to the line
source image destination image
CROSS DISSOLVING
A cross-dissolve is a sequence of images which implements a gradual
fade from one to the other.
At t source image is mapped to destination image and destination
image is mapped to source image.
DEMO
References:
Warping and Morphing of Graphical Objects by Bruno Costa, Jonas Gomes ,1998.
Morphing Magic by Scott Anderson , 1993
Beier T. Neely S. Feature based image metamorphosis. Proceedings of SIGGRAPH92
http://www.cs.rochester.edu/u/www/u/kyros/Courses/CS290B/Lectures/lecture-
18/sld002.htm

You might also like