Lecture 13: Procrustes, ICP COMPSCI/MATH 290-04 Chris Tralie, Duke - - PowerPoint PPT Presentation

lecture 13 procrustes icp
SMART_READER_LITE
LIVE PREVIEW

Lecture 13: Procrustes, ICP COMPSCI/MATH 290-04 Chris Tralie, Duke - - PowerPoint PPT Presentation

Lecture 13: Procrustes, ICP COMPSCI/MATH 290-04 Chris Tralie, Duke University 2/25/2016 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP Announcements Group Assignment 1 Full Submission Due next Tuesday 11:55 PM Hackathon Saturday 2/27


slide-1
SLIDE 1

Lecture 13: Procrustes, ICP

COMPSCI/MATH 290-04

Chris Tralie, Duke University

2/25/2016

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-2
SLIDE 2

Announcements

⊲ Group Assignment 1 Full Submission Due next Tuesday 11:55 PM ⊲ Hackathon Saturday 2/27 4:00 PM - 10:00 PM Gross Hall 330 ⊲ Rank Top 3 Final Project Choices By Next Wednesday 3/2 (Groups of 3-4)

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-3
SLIDE 3

Table of Contents

◮ Procrustes SVD Derivation ⊲ ICP

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-4
SLIDE 4

Procrustes Rotation Problem

Given correspondences, find best rotation

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-5
SLIDE 5

Rotating to Align Points: Dot Product Perspective

Points are well aligned if

  • x1 ·

y1 = || x1|||| y1|| cos(θ) is maximized

x1 y1

θ

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-6
SLIDE 6

Rotating to Align Points: Dot Product Perspective

Points are well aligned if

  • x1 ·

y1 = || x1|||| y1|| cos(θ) is maximized

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-7
SLIDE 7

Rotating to Align Points: Dot Product Perspective

In general, how to maximize?

N

  • i=1

Rx xi · Ry yi

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-8
SLIDE 8

Rotating to Align Points: Dot Product Perspective

In general, how to maximize?

N

  • i=1

Rx xi · Ry yi VIDEO EXAMPLE

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-9
SLIDE 9

Choosing Orthogonal Dot Product Axes

N

  • i=1

   −

  • Rx1

− −

  • Rx2

− −

  • Rx3

−      |

  • xi

|   ·    −

  • Ry1

− −

  • Ry2

− −

  • Ry3

−      |

  • yi

|   Ry1 Ry2 Rx1 Rx2

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-10
SLIDE 10

Choosing Orthogonal Dot Product Axes

N

  • i=1

   −

  • Rx1

− −

  • Rx2

− −

  • Rx3

−      |

  • xi

|   ·    −

  • Ry1

− −

  • Ry2

− −

  • Ry3

−      |

  • yi

|   = ( Rx1 · xi)( Ry1 · yi) + ( Rx2 · xi)( Ry2 · yi) + ( Rx3 · xi)( Ry3 · yi)

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-11
SLIDE 11

Maximizing Dot Product: First Component

How to maximize N

i=1(

Rx1 · xi)( Ry1 · yi)? Ry1 Ry2 Rx1 Rx2 yi xi

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-12
SLIDE 12

Maximizing Dot Product: First Component

Rx1X, Ry1Y How to write N

i=1(

Rx1 · xi)( Ry1 · yi) in matrix form?

Ry1 Ry2 Rx1 Rx2 yi xi

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-13
SLIDE 13

Maximizing Dot Product: First Component

Rx1X, Ry1Y How to write N

i=1(

Rx1 · xi)( Ry1 · yi) in matrix form? (Rx1X)(Ry1Y)T = Rx1XY TRT

y1 Ry1 Ry2 Rx1 Rx2 yi xi

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-14
SLIDE 14

Maximizing Dot Product: First Component

How to find u1 and v1 that maximize this product? (Rx1X)(Ry1Y)T = Rx1XY TRT

y1

Take SVD: XY T = USV T and substitute in Rx1USV TRT

y1

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-15
SLIDE 15

Maximizing Dot Product: First Component

Rx1USV TRT

y1

  • Rx1

 | | |

  • u1
  • u2
  • u3

| | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     |

  • Ry1

|   Assume s1 > s2 > s3, remember that U and V are orthogonal

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-16
SLIDE 16

Maximizing Dot Product: First Component

Rx1USV TRT

y1

  • Rx1

 | | |

  • u1
  • u2
  • u3

| | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     |

  • Ry1

|   Assume s1 > s2 > s3, remember that U and V are orthogonal Raffle point question: Choose Rx1 and Ry1 to maximize this component of the dot product

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-17
SLIDE 17

Maximizing Dot Product: First Component

Rx1USV TRT

y1

  • Rx1

 | | |

  • u1
  • u2
  • u3

| | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     |

  • Ry1

|   Assume s1 > s2 > s3

  • Rx1 =

u1, Ry1 = v1 In other words ⊲ First row of Rx is first column of U ⊲ First row of Ry is first column of V

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-18
SLIDE 18

Maximizing Dot Product: Second Component

What about the second rows of Rx and Ry for second component of dot product? Rx1USV TRT

y1

Rx2USV TRT

y2

  • Rx2

 | | |

  • u1
  • u2
  • u3

| | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     |

  • Ry2

|   Assume s1 > s2 > s3

N

  • i=1

( Rx1 · xi)( Ry1 · yi)

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-19
SLIDE 19

Maximizing Dot Product: Full Rotation Matrix

  −

  • u1

− −

  • u2

− −

  • u3

−     | | |

  • u1
  • u2
  • u3

| | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     | | |

  • v1
  • v2
  • v3

| | |  

RxUSV TRT

y

Assume s1 > s2 > s3 ◮ Final answer for optimal rotations: Rx = UT, Ry = V T (Carefully working with transposes)

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-20
SLIDE 20

Maximizing Dot Product: Full Rotation Matrix

◮ Final answer for optimal rotations: Rx = UT, Ry = V T What if I want to just rotate Y and keep X fixed? What should Ry be?

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-21
SLIDE 21

Maximizing Dot Product: Full Rotation Matrix

◮ Final answer for optimal rotations: Rx = UT, Ry = V T What if I want to just rotate Y and keep X fixed? What should Ry be? Ry = UV T This is just SVD of XY T without S !

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-22
SLIDE 22

Enforcing Right Handedness

  −

  • u1

− −

  • u2

− −

  • u3

−     | | |

  • u1
  • u2

± u3 | | |     s1 s2 s3     −

  • v1

− −

  • v2

− −

  • v3

−     |

  • v1

|

Check if u1 × u2 =

  • u3. If not, switch the sign of
  • u3. This subtracts from

the function we’re trying to maximize, but it does the minimal damage since s3 < s2 < s1

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-23
SLIDE 23

Rotation to Align Points: Algebra

N

  • i=1

||R xi − yi||2

2

How is this the same thing as maximizing sum of dot products? ||R x − y||2 = (R x − y) · (R x − y)

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-24
SLIDE 24

Rotation to Align Points: Algebra

N

  • i=1

||R xi − yi||2

2

How is this the same thing as maximizing sum of dot products? ||R x − y||2 = (R x − y) · (R x − y) (R x − y) · (R x − y) = R x · R x + y · y − 2R x · y

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-25
SLIDE 25

Rotation to Align Points: Algebra

N

  • i=1

||R xi − yi||2

2

How is this the same thing as maximizing sum of dot products? ||R x − y||2 = (R x − y) · (R x − y) (R x − y) · (R x − y) = R x · R x + y · y − 2R x · y (R x − y) · (R x − y) = ||R x||2 + || y||2 − 2R x · y

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-26
SLIDE 26

Procrustes Application: Moving Head Alignment

VIDEO DEMO

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-27
SLIDE 27

Procrustes Application: Average Faces

Average Spaniards

https://pmsol3.wordpress.com/2011/04/07/world-of-averages-europeave/ COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-28
SLIDE 28

Procrustes Application: Average Faces

Average Spaniards

https://pmsol3.wordpress.com/2011/04/07/world-of-averages-europeave/ COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-29
SLIDE 29

Table of Contents

⊲ Procrustes SVD Derivation ◮ ICP

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-30
SLIDE 30

ICP

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-31
SLIDE 31

ICP Example

⊲ Iterative Closest Points ⊲ Iterative Closest Pairs ⊲ Iterative Corresponding Points Goal: Automatically align two point sets

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-32
SLIDE 32

ICP Example

First mean center, now how to find correspondences automatically?

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-33
SLIDE 33

ICP Example

Use Nearest Neighbor, then do procrustes with those correspondences Some blue points may be duplicated!

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-34
SLIDE 34

ICP Example

Use Nearest Neighbor, then do procrustes with those correspondences Some points may be repeated!

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-35
SLIDE 35

ICP Example

Continue, interactive...

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-36
SLIDE 36

ICP Computation

Steps in ICP Loop

  • 1. Find nearest neighbors
  • 2. Procrustes rotation matrix
  • 3. Rotate Y Points, go back to step 1

For N points in X and Y, what is time complexity of each step?

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-37
SLIDE 37

ICP Examples / Pitfalls

Video Examples

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP

slide-38
SLIDE 38

Final Projects

Choices

  • 1. Equidecomposing polygon meshes into each other in

3D, with SLERP animation

  • 2. Ghissi Alterpiece: Real Time Rendering Effects for NC

Museum of Art

  • 3. Nasher Muesum Brummer Statue Heads Speech

Transfer

  • 4. MOCAP Data Animation in Browser / Skinning / 3D

Lemur Tracking(?)

  • 5. 3D Face Verification

OR

  • 6. Individual project with approval

COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP