Feature Line Image Morphing
Tong-Yee Lee
Beier&Neely (SIGGRAPH 1992)
An Ideal Example
color blending (r,g,b)
src
dst
Cross-Dissolving
(r,g,b)
Dog Averaging
What to do?
Ghost effect
Blending is still useful and has some applications when shapes are similar by just replacement
Image morphing
image #1
image #2
dissolving
Image Morphing
t= 0
t=1
t= 0.5
Image Morphing
Ideally change shapes during morphing
Image morphing
morphing
cross-dissolving
image #1
image #2
warp
warp
Morphing procedure:
for every t,
1. Find the average shape (the “mean dog”☺)
- local warping
2. Find the average color
- Cross-dissolve the warped images
Image morphing
shape
(geometric)
color
(photometric)
Image Morphing
Warp Specification
How can we specify the warp?
t = 0
t=1
P_t = (1-t) *P_L + t* P_R
control line: P_t
Each line: starting point (x1,y1) and ending point (x2,y2)
A control line vector (x2-x1, y2-y1)
Control Line Vector
(0,0)
morphing
image #1
image #2
warp
warp
t= 0
t= 1
t
Color t = (1-t)Color_L+tColor_R
t= 0
t=1
t= 0.5
(0,0)
t= 0
t= 0.5
t= 1
Image Morphing
�How do we compute colors at dest pixels? (resampling�
Two Options
Forward Mapping - Problems
holes
Holes
Forward mapping
by rotation
Inverse mapping
Backward Mapping
t
1-t
Feature-based Warping
But, u is fraction but not length, it will make correspondence between two control lines with different lengths
Beier&Neely (SIGGRAPH 1992)
(0,0)
The dot product is useful for several things. One of the important uses is in a formula for finding the angle between two vectors that have the same initial point.
u
v
θ
Technically there are two angles between these vectors, one going the "shortest" way and one going around the other way. We are talking about the smaller of the two.
||v||cosθ >0
if θ <90
https://www.mathsisfun. com/sine-cosine-tangent.html
Assume (Q-P)
= (a,b)
Perpendicular
(Q-P) = (b, -a)
x
y
(a,b)
(b,-a)
u>0
u<0
(Q-P)
x >0 such as (1,0)
Warping with One line pair
Warping with One line pair
Warping with One line pair
Warping with One line pair
Warping with Multiple Line Pairs
(0,0)
(h-1,0)
(w-1,0)
(h-1,w-1)
Warping with Multiple Line Pairs
Weighting Effect of Each Line Pair
A constant a is used to avoid dividing by a zero distance[i]
Ex: p’=w1/(w1+w2)p1+w2/(w1+w2)p2
p1
p2
Color at p = Color at p’
Weight is computed for each line on destination image
Note: we need to compute color in a bilinear way
Warping Psuedocode
Berier and Neeley’s Examples
Warping Psuedocode
Morphing is not only for faces
http://www.fantamorph.com/index.html
Summary
Image warping
Image morphing
Multiple Image Morphing
Barycentric coordinates
Barycentric coordinates
t1 = Area(p,A2,A3)/Area(A1,A2,A3)
t2 = Area(p,A1,A3)/Area(A1,A2,A3)
t3 = Area (p,A1,A2)/Area(A1,A2,A3)
Convert to mesh warping
Define a triangular mesh over the points
Some application:�Medical slice interpolation
Tong-Yee Lee, Chao-Hung Lin
Feature-guided Shape-based Image Interpolation
IEEE Transactions on Medical Imaging, Vol. 21, No. 12, pp. 1479-1489.2002 [Web]
Some application in 3D Morphing
Tong-Yee Lee, P.H Huang.�Fast and Institutive Polyhedra Morphing Using SMCC Mesh Merging Scheme.�IEEE Transactions on Visualization and Computer Graphics, Vol. 9, No. 1, pp. 85-98, 2003 [Web]
Warping from 3D to 2D
Matching feature points by warping
Basic Idea
View Morphing
http://homes.cs.washington.edu/~seitz/vmorph/vmorph.htm
Need to consider view transformation when morphing
Some Image Morphing examples(Lab. Member HW1) Results Demo in 2016