Image Morphing�and related work
Tong-Yee Lee
Blending
Image Morphing Example
An Ideal Example
color blending (r,g,b)
Cross-Dissolving
Dog Averaging
What to do?
Ghost artefacts or half-shade effects occur if the two morphed images are not aligned correctly
Image morphing
image #1
image #2
dissolving
Blending Art
Image stitching v.s. Panorama�
This sample image shows geometrical registration and stitching lines in panorama creation, i.e., requiring alignment, warping and then stitiching
Simple case maybe
alignment is OK!
Warping is needed for more
general input images
This algorithm explores image blending by gradient-domain processing, allowing a user to implant a region of a source image into a target image. The most basic implementation of such an algorithm would directly copy the source pixels into the target image, but for obvious reasons, the resulting image is less than convincing. The most noticeable problem with pixel copying is that it creates very noticeable seams, or high frequency pixel areas, at the edges of the copied region. To create a more perceptually subtle blending process, it must be noted that human visual perception is more sensitive to gradients than to individual intensities. Therefore, to create a seamless blend, the original pixel gradients of both the target image and the copied source region must be preserved as much as possible.
Image Blending
i.e., gradients
Directly copy the source pixels into the target image
The original pixel gradients of both the target image and the copied source region must be preserved as much as possible
Image Morphing
Image Morphing
Image morphing
morphing
cross-dissolving
image #1
image #2
warp
warp
Warping is key and hard part !!!
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
A control line:
A point to B point
A 🡪 A’ t=0, 1
B 🡪 B’
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
blending
t= 0.5
warping
t= 0.5
warping
t= 0
t= 0.5
t= 1
t= 0.5
warping
t= 0.5
warping
t= 0.5
blending
Image Morphing
t= 0.5
�How do we compute colors at dest pixels? (resampling�
Two Options
Forward Mapping - Problems
holes
Backward Mapping
t
1-t
Feature-based Warping
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)
u is a fraction
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
Warping with Multiple Line Pairs
Weighting Effect of Each Line Pair
a= a constant near 1, b = [0.5,2], p = [0,1]
Ex: p’=w1/(w1+w2)p1+w2/(w1+w2)p2
p1
p2
Color at p = Color at p’
Warping Psuedocode
Berier and Neeley’s Examples
Warping Psuedocode
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)
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]
Another solution: convert to mesh warping
Issue: How to find triangle-to-triangle
correspondences?
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
Computer Animation
Shape Interpolation
Mesh Deformation
Mesh Deformation (Cont’d)
Shape Interpolation (Cont’d)
Animation Result�Result 3
Linear Interpolation
(Latent Space)
Path Exploration
(Latent Space)
Linear Interpolation
(Mesh Vertices)
Animation Result�Result 5
Linear Interpolation
Path Exploration
Input models�Result 6
Source model
Target model
Animation Result�Result 6
Linear Interpolation
Path Exploration