1 of 60

Image Morphing�and related work

Tong-Yee Lee

Blending

2 of 60

Image Morphing Example

3 of 60

An Ideal Example

color blending (r,g,b)

4 of 60

Cross-Dissolving

  • Blend images with over operator

5 of 60

Dog Averaging

What to do?

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

Ghost artefacts or half-shade effects occur if the two morphed images are not aligned correctly 

6 of 60

Image morphing

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

image #1

image #2

dissolving

  • Cross dissolving is a common transition between cuts, but it is not good for morphing because of the ghosting effects.

7 of 60

Blending Art

8 of 60

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

9 of 60

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

10 of 60

Image Morphing

  • Animate transitions between two images
    • Specify Correspondence
    • Warping
    • Blending

11 of 60

Image Morphing

  • Combine warping and cross-dissolving

12 of 60

Image morphing

morphing

cross-dissolving

image #1

image #2

warp

warp

Warping is key and hard part !!!

13 of 60

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

14 of 60

Image morphing

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

shape

(geometric)

color

(photometric)

15 of 60

Image Morphing

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

16 of 60

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.

17 of 60

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’

18 of 60

morphing

image #1

image #2

warp

warp

t= 0

t= 1

t

Color t = (1-t)Color_L+tColor_R

19 of 60

t= 0

t=1

t= 0.5

blending

t= 0.5

warping

t= 0.5

warping

20 of 60

t= 0

t= 0.5

t= 1

t= 0.5

warping

t= 0.5

warping

t= 0.5

blending

21 of 60

Image Morphing

t= 0.5

22 of 60

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

23 of 60

Two Options

24 of 60

Forward Mapping - Problems

holes

25 of 60

Backward Mapping

 

t

1-t

26 of 60

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?

27 of 60

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

28 of 60

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

29 of 60

Warping with One line pair

  • What happen to the F?

30 of 60

Warping with One line pair

  • What happen to the F?

31 of 60

Warping with One line pair

  • What happen to the F?

32 of 60

Warping with One line pair

  • What happen to the F?

33 of 60

Warping with Multiple Line Pairs

34 of 60

Warping with Multiple Line Pairs

35 of 60

Weighting Effect of Each Line Pair

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

a= a constant near 1, b = [0.5,2], p = [0,1]

36 of 60

Ex: p’=w1/(w1+w2)p1+w2/(w1+w2)p2

p1

p2

Color at p = Color at p’

37 of 60

Warping Psuedocode

38 of 60

Berier and Neeley’s Examples

39 of 60

Warping Psuedocode

40 of 60

41 of 60

Summary

Image warping

Image morphing

42 of 60

Multiple Image Morphing

43 of 60

Barycentric coordinates

44 of 60

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)

45 of 60

46 of 60

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]

47 of 60

Another solution: convert to mesh warping

  1. Define a triangular mesh over the points
    • Same mesh in both images!
    • Now we have triangle-to-triangle correspondences
  2. Warp each triangle separately from source to destination
    • How do we warp a triangle?
    • 3 points = affine warp!
    • Just like texture mapping

Issue: How to find triangle-to-triangle

correspondences?

48 of 60

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]

49 of 60

Warping from 3D to 2D

Matching feature points by warping

Basic Idea

50 of 60

View Morphing

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

51 of 60

Computer Animation

  • Skeletal Animation
  • Keyframe Animation

52 of 60

Shape Interpolation

  • As-Rigid-As-Possible Shape Interpolation [Alexa, Marc, Daniel Cohen-Or, and David Levin, 2000]

53 of 60

Mesh Deformation

  • Deformation Transfer for Triangle Meshes [Robert W. Sumner and Jovan Popovic, 2004]

54 of 60

Mesh Deformation (Cont’d)

  • Segmenting a deforming mesh into near-rigid components [T.-Y. Lee, Y.-S. Wang, and T.-G. Chen, 2006]

55 of 60

Shape Interpolation (Cont’d)

  • Multi-resolution Mean Shift Clustering Algorithm for Shape Interpolation [Hung-Kuo Chu and Tong-Yee Lee, TVCG 2009]

56 of 60

57 of 60

Animation Result�Result 3

Linear Interpolation

(Latent Space)

Path Exploration

(Latent Space)

Linear Interpolation

(Mesh Vertices)

58 of 60

Animation Result�Result 5

Linear Interpolation

Path Exploration

59 of 60

Input models�Result 6

Source model

Target model

60 of 60

Animation Result�Result 6

Linear Interpolation

Path Exploration