Warps and Morphs Applications of Linear Algebra Mike Land and - - PowerPoint PPT Presentation

warps and morphs
SMART_READER_LITE
LIVE PREVIEW

Warps and Morphs Applications of Linear Algebra Mike Land and - - PowerPoint PPT Presentation

1/30 Warps and Morphs Applications of Linear Algebra Mike Land and Tara Puzin College of the Redwoods Mathematics Department, Eureka, California email: michaelland37@yahoo.com email: toootsiepop@yahoo.com


slide-1
SLIDE 1

1/30

  • Warps and Morphs

Applications of Linear Algebra

Mike Land and Tara Puzin

College of the Redwoods Mathematics Department, Eureka, California email: michaelland37@yahoo.com email: toootsiepop@yahoo.com

slide-2
SLIDE 2

2/30

  • Introduction
  • What is Morphing?
  • The word morph derives from the word metamorphosis meaning to

change shape or form.

  • Morphing is achieved by compiling several images that are gradually

distorted and faded out while the destination image is faded in.

  • In this presentation we will develop a mathematical process that

allows for the metamorphosis of one digital image into another.

slide-3
SLIDE 3

3/30

  • An Example of Morphs and Warps
  • The girl in the picture morphs into a frog.
slide-4
SLIDE 4

4/30

  • Objective

Destination Image Source Image

slide-5
SLIDE 5

5/30

  • Process
  • In order to achieve this we will draw a line on the source image and

destination image. Destination Image Source Image

slide-6
SLIDE 6

6/30

  • First Steps
  • In order to calculate the color we let each pixel be represented by X

and X′.

  • We will calculate the color of X′ in the source image and pour that

color into X in the destination image.

  • In order to accomplish this we will need to calculate u and v.
  • u is a percentage up the line PQ, and v is a set distance away from

the line PQ.

slide-7
SLIDE 7

7/30

  • Finding u

Start with X in the destination image. Project − − → PX onto − → PQ to deter- mine u. u = (X − P) · (Q − P) (Q − P) · (Q − P)

P Q X u Destination Image

slide-8
SLIDE 8

8/30

  • Finding v

Project − − → PX onto the unit vector perpendicular to − → PQ. v = (X − P) · perp(Q − P) |(Q − P)|

P Q X u v Destination Image perp(Q − P) perp(Q − P)/|Q − P|

slide-9
SLIDE 9

9/30

  • Finding X′ in Source Image

Start at P ′. Move along − − → P ′Q′ the same per- centage u that we moved along − → PQ in the destination image. Move perpendicular to − − → P ′Q′ a distance v, the same v com- puted in the destination image.

P ′ Q′ X′ u v Source Image

slide-10
SLIDE 10

10/30

  • Calculating X′

X′ = P ′ + u · (Q′ − P ′) + v · perp(Q′ − P ′) |(Q′ − P ′)|

slide-11
SLIDE 11

11/30

  • One Line

Destination Image Source Image

slide-12
SLIDE 12

12/30

  • Warp with One Line

Destination Image Source Image

slide-13
SLIDE 13

13/30

  • Two Lines

P1 Q1 u1 v1 P2 Q2 u2 v2 X Destination Image

slide-14
SLIDE 14

14/30

  • Calculating u1, u2, v1, and v2

u1 = (X − P1) · (Q1 − P1) (Q1 − P1) · (Q1 − P1) u2 = (X − P2) · (Q2 − P2) (Q2 − P2) · (Q2 − P2) v1 = (X − P1) · perp(Q1 − P1) |(Q1 − P1)| v2 = (X − P2) · perp(Q2 − P2) |(Q2 − P2)|

slide-15
SLIDE 15

15/30

  • Calculate X′

1and X′ 2

P ′

1

P ′

2

Q′

1

Q′

2

X′

1

X′

2

u1 u2 v1 v2 Source Image

slide-16
SLIDE 16

16/30

  • Calculate the Displacement

Calculate the displacements D1 and D2 in order to find X′. D1 = X′

1 − X

D2 = X′

2 − X P ′

1

P ′

2

Q′

1

Q′

2

X X′

1

X′

2

D1 D2 u1 u2 v1 v2 Source Image

slide-17
SLIDE 17

17/30

  • Calculate the Weight for Each Displace-

ment.

We now want to compute a weighted average of our displacements. We use the following formula for the weights. Weight = lengthp a + dist b Length is the length of the line PiQi Dist is the distance from the pixel to the line. Parameters a, b, and p are constants that can be used to change the relative effect of the lines.

slide-18
SLIDE 18

18/30

  • Weighted Average

P ′

1

P ′

2

Q′

1

Q′

2

X X′

1

X′

2

D1 D2 u1 u2 v1 v2 Source Image

W1D1 + W2D2 W1 + W2

slide-19
SLIDE 19

19/30

  • Calculating X′ by Adding the Weighted

Average

P ′

1

P ′

2

Q′

1

Q′

2

X X′

1

X′

2

X′ u1 u2 v1 v2 Source Image

slide-20
SLIDE 20

20/30

  • X′ = X + W1D1 + W2D2

W1 + W2

slide-21
SLIDE 21

21/30

  • Warp with Two Lines

Destination Image Source Image

slide-22
SLIDE 22

22/30

  • Warp with Two Lines

Destination Image Source Image

slide-23
SLIDE 23

23/30

  • Back to Our Objective

Destination Image Source Image

slide-24
SLIDE 24

24/30

  • Rush Lines to Squid man Lines

Rush Destination Image Rush Source Image

slide-25
SLIDE 25

25/30

  • Rush Sequence Lines
slide-26
SLIDE 26

26/30

  • Warp Rush Sequence
slide-27
SLIDE 27

27/30

  • Rush to Squid Man Lines
slide-28
SLIDE 28

28/30

  • Squid Man to Rush Lines
slide-29
SLIDE 29

29/30

  • Forwards and Backwards
slide-30
SLIDE 30

30/30

  • Blending the Morph