1 of 52

Feature Line Image Morphing

Tong-Yee Lee

Beier&Neely (SIGGRAPH 1992)

2 of 52

An Ideal Example

color blending (r,g,b)

src

dst

3 of 52

Cross-Dissolving

  • Blend images with over operator

(r,g,b)

4 of 52

Dog Averaging

What to do?

    • Cross-dissolve doesn’t work
    • Any ideas?

Ghost effect

5 of 52

Blending is still useful and has some applications when shapes are similar by just replacement

6 of 52

Image morphing

  • The goal is to synthesize a smooth transformation from one image to another.

image #1

image #2

dissolving

  • Cross dissolving is not good for morphing because of the ghosting effects.

7 of 52

Image Morphing

  • Animate transitions between two images
    • Specify Correspondence
    • Warping to change shapes
    • Blending

t= 0

t=1

t= 0.5

8 of 52

Image Morphing

  • Combine warping and cross-dissolving

Ideally change shapes during morphing

9 of 52

Image morphing

morphing

cross-dissolving

image #1

image #2

warp

warp

10 of 52

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

11 of 52

Image morphing

  • Why ghosting?
  • Morphing = warping + cross-dissolving

shape

(geometric)

color

(photometric)

12 of 52

Image Morphing

  • The warping step is the hard one
    • Aim is to align features in images

13 of 52

Warp Specification

How can we specify the warp?

    • Specify corresponding vectors
      • interpolate to a complete warping function
      • The Beier & Neely Algorithm�
  • Thaddeus Beier, Shawn Neely, Feature-Based Image Metamorphosis, SIGGRAPH 1992, pp35-42.

14 of 52

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)

15 of 52

morphing

image #1

image #2

warp

warp

t= 0

t= 1

t

Color t = (1-t)Color_L+tColor_R

16 of 52

t= 0

t=1

t= 0.5

(0,0)

17 of 52

t= 0

t= 0.5

t= 1

18 of 52

Image Morphing

19 of 52

�How do we compute colors at dest pixels? (resampling�

20 of 52

Two Options

21 of 52

Forward Mapping - Problems

holes

22 of 52

23 of 52

Holes

Forward mapping

by rotation

Inverse mapping

24 of 52

25 of 52

26 of 52

Backward Mapping

 

t

1-t

27 of 52

Feature-based Warping

  • Berier and Neeley use feature pairs of lines to control warp
    • Given a pixel P in dest image, where is P in source image?

But, u is fraction but not length, it will make correspondence between two control lines with different lengths

Beier&Neely (SIGGRAPH 1992)

(0,0)

28 of 52

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

29 of 52

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)

30 of 52

Warping with One line pair

  • What happen to the F?

31 of 52

Warping with One line pair

  • What happen to the F?

32 of 52

Warping with One line pair

  • What happen to the F?

33 of 52

Warping with One line pair

  • What happen to the F?

34 of 52

Warping with Multiple Line Pairs

(0,0)

(h-1,0)

(w-1,0)

(h-1,w-1)

35 of 52

Warping with Multiple Line Pairs

36 of 52

Weighting Effect of Each Line Pair

  • To weight contribution of each line pair
    • T. Berier and Neeley use:

A constant a is used to avoid dividing by a zero distance[i]

37 of 52

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

38 of 52

Warping Psuedocode

39 of 52

Berier and Neeley’s Examples

40 of 52

Warping Psuedocode

41 of 52

42 of 52

Morphing is not only for faces

http://www.fantamorph.com/index.html

43 of 52

Summary

Image warping

Image morphing

44 of 52

Multiple Image Morphing

45 of 52

Barycentric coordinates

46 of 52

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)

47 of 52

Convert to mesh warping

Define a triangular mesh over the points

    • Same mesh in both images!
    • Now we have triangle-to-triangle correspondences
    • Need to find a good corresponding mesh mapping

48 of 52

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]

49 of 52

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]

50 of 52

Warping from 3D to 2D

Matching feature points by warping

Basic Idea

51 of 52

View Morphing

http://homes.cs.washington.edu/~seitz/vmorph/vmorph.htm

Need to consider view transformation when morphing

  1. Do a morphing on a specific view
  2. Rotation the morphing results to a selected view

52 of 52

Some Image Morphing examples(Lab. Member HW1) Results Demo in 2016