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 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
Table of Contents ◮ Procrustes SVD Derivation ⊲ ICP COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Procrustes Rotation Problem Given correspondences, find best rotation COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotating to Align Points: Dot Product Perspective Points are well aligned if x 1 · � � y 1 = || � x 1 |||| � y 1 || cos ( θ ) is maximized x1 y1 θ COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotating to Align Points: Dot Product Perspective Points are well aligned if x 1 · � � y 1 = || � x 1 |||| � y 1 || cos ( θ ) is maximized COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotating to Align Points: Dot Product Perspective In general, how to maximize? N � R x � x i · R y � y i i = 1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotating to Align Points: Dot Product Perspective In general, how to maximize? N � R x � x i · R y � y i i = 1 VIDEO EXAMPLE COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Choosing Orthogonal Dot Product Axes � � − R x 1 − − R y 1 − | | N � � · � � � − R x 2 − x i − R y 2 − y i � | � | i = 1 − R x 3 − − R y 3 − Ry1 Ry2 Rx2 Rx1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Choosing Orthogonal Dot Product Axes � � − R x 1 − | − R y 1 − | N � � · � � � x i y i − R x 2 − − R y 2 − � | � | i = 1 − R x 3 − − R y 3 − = ( � x i )( � y i ) + ( � x i )( � y i ) + ( � x i )( � R x 1 · � R y 1 · � R x 2 · � R y 2 · � R x 3 · � R y 3 · � y i ) COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component How to maximize � N i = 1 ( � x i )( � R x 1 · � R y 1 · � y i ) ? Ry1 yi Ry2 Rx2 xi Rx1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component R x 1 X , R y 1 Y How to write � N i = 1 ( � x i )( � R x 1 · � R y 1 · � y i ) in matrix form? Ry1 yi Ry2 Rx2 xi Rx1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component R x 1 X , R y 1 Y How to write � N i = 1 ( � x i )( � R x 1 · � R y 1 · � y i ) in matrix form? ( R x 1 X )( R y 1 Y ) T = R x 1 XY T R T y 1 Ry1 yi Ry2 Rx2 xi Rx1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component How to find u 1 and v 1 that maximize this product? ( R x 1 X )( R y 1 Y ) T = R x 1 XY T R T y 1 Take SVD: XY T = USV T and substitute in R x 1 USV T R T y 1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component R x 1 USV T R T y 1 | | | − � − | s 1 0 0 v 1 � � � � � � � − � − − R x 1 − u 1 u 2 u 3 0 s 2 0 v 2 R y 1 | | | 0 0 s 3 − v 3 � − | Assume s 1 > s 2 > s 3 , remember that U and V are orthogonal COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component R x 1 USV T R T y 1 | | | − � − | s 1 0 0 v 1 � � � � � � � − � − − R x 1 − u 1 u 2 u 3 0 s 2 0 v 2 R y 1 | | | 0 0 s 3 − v 3 � − | Assume s 1 > s 2 > s 3 , remember that U and V are orthogonal Raffle point question: Choose � R x 1 and � R y 1 to maximize this component of the dot product COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: First Component R x 1 USV T R T y 1 | | | s 1 0 0 − v 1 � − | � � � � u 1 � u 2 � u 3 � 0 s 2 0 − v 2 � − − R x 1 − R y 1 | | | 0 0 s 3 − v 3 � − | Assume s 1 > s 2 > s 3 � u 1 , � R x 1 = � R y 1 = � v 1 In other words ⊲ First row of R x is first column of U ⊲ First row of R y is first column of V COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: Second Component What about the second rows of R x and R y for second component of dot product? R x 1 USV T R T y 1 R x 2 USV T R T y 2 � | | | | s 1 0 0 − v 1 − � � � � � � � � − R x 2 − u 1 u 2 u 3 0 s 2 0 − v 2 − R y 2 | | | − � − 0 0 s 3 v 3 | Assume s 1 > s 2 > s 3 N � ( � x i )( � R x 1 · � R y 1 · � y i ) i = 1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: Full Rotation Matrix − � − | | | − � − | | | u 1 s 1 0 0 v 1 − u 2 � − u 1 � u 2 � u 3 � 0 s 2 0 − v 2 � − � v 1 v 2 � v 3 � − u 3 � − | | | 0 0 s 3 − v 3 � − | | | R x USV T R T y Assume s 1 > s 2 > s 3 ◮ Final answer for optimal rotations: R x = U T , R y = V T (Carefully working with transposes) COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: Full Rotation Matrix ◮ Final answer for optimal rotations: R x = U T , R y = V T What if I want to just rotate Y and keep X fixed? What should R y be? COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Maximizing Dot Product: Full Rotation Matrix ◮ Final answer for optimal rotations: R x = U T , R y = V T What if I want to just rotate Y and keep X fixed? What should R y be? R y = UV T This is just SVD of XY T without S ! COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Enforcing Right Handedness − u 1 � − | | | s 1 0 0 − v 1 � − | � � � ± � � � − u 2 − u 1 u 2 u 3 0 s 2 0 − v 2 − v 1 − u 3 � − | | | 0 0 s 3 − v 3 � − | Check if � u 1 × � u 2 = � u 3 . If not, switch the sign of � u 3 . This subtracts from the function we’re trying to maximize, but it does the minimal damage since s 3 < s 2 < s 1 COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotation to Align Points: Algebra N � y i || 2 || R � x i − � 2 i = 1 How is this the same thing as maximizing sum of dot products? y || 2 = ( R � || R � x − � x − � y ) · ( R � x − � y ) COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotation to Align Points: Algebra N � y i || 2 || R � x i − � 2 i = 1 How is this the same thing as maximizing sum of dot products? y || 2 = ( R � || R � x − � x − � y ) · ( R � x − � y ) ( R � x − � y ) · ( R � x − � y ) = R � x · R � x + � y · � y − 2 R � x · � y COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Rotation to Align Points: Algebra N � y i || 2 || R � x i − � 2 i = 1 How is this the same thing as maximizing sum of dot products? y || 2 = ( R � || R � x − � x − � y ) · ( R � x − � y ) ( R � x − � y ) · ( R � x − � y ) = R � x · R � x + � y · � y − 2 R � x · � y x || 2 + || � y || 2 − 2 R � ( R � x − � y ) · ( R � x − � y ) = || R � x · � y COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Procrustes Application: Moving Head Alignment VIDEO DEMO COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
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
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
Table of Contents ⊲ Procrustes SVD Derivation ◮ ICP COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
ICP COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
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
ICP Example First mean center, now how to find correspondences automatically? COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
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
ICP Example Use Nearest Neighbor, then do procrustes with those correspondences Some points may be repeated! COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
ICP Example Continue, interactive... COMPSCI/MATH 290-04 Lecture 13: Procrustes, ICP
Recommend
More recommend