LLeast-Squares Affine Reflection Using Eigen Decomposition
ALEC JACOBSON,
University of Toronto, Canada
This note summarizes the steps to computing the best-fitting affine reflectionthat aligns two sets of corresponding points. d ˆ n P Q
Let P = { p , . . . , p m } and Q = { q , . . . , q m } contain sets of m corresponding points p i , q i ∈ R D . We wish to find an affine re-flection (i.e., reflection across a hyperplane)that optimally aligns the two sets in the leastsquares sense. That is, we seek the unit nor-mal vector (ˆ n ∈ R D , ∥ ˆ n ∥ =
1) and scalardistance from the origin ( d ∈ R ) describinga hyperplane (ˆ n · p = d ) such that ( ˆ n , d ) = argmin ˆ n ∈ R d , ∥ ˆ n ∥ = , d ∈ R m (cid:213) i = ∥( p i − ( p i · ˆ n − d ) ˆ n ) − q i ∥ . (1) Fixing ˆ n , denote F ( d ) = (cid:205) mi = ∥( p i − ( p i · ˆ n − d ) ˆ n ) − q i ∥ . We canfind the optimal scalar term d by taking the derivative of F withrespect to d and searching for its roots:0 = ∂ F ∂ d = m (cid:213) i = n ⊤ (( p i − ( p i · ˆ n − d ) ˆ n ) − q i ) , (2) = m (cid:213) i = d ˆ n ⊤ ˆ n + n ⊤ (cid:0) p i − n ˆ n ⊤ p i − q i (cid:1) (3) (recalling that ˆ n ⊤ ˆ n = ∥ ˆ n ∥ = ) = md − n ⊤ (cid:32) m (cid:213) i = p i + q i (cid:33) . (4)Let us introduce c ∈ R d to represent the centroid of all points : Step 1 c = m (cid:32) m (cid:213) i = p i + m (cid:213) i = q i (cid:33) . (5)Substituting these into Equation (4), we can express the optimalscalar d in terms of c and the (yet unknown) optimal ˆ n : Step 5 d = c · ˆ n . (6)In other words, the optimal scalar term ensures that the combinedcentroid of the two sets lies on the reflective plane. Or, equivalently,that the centroid of P reflects to the centroid of Q . I have attempted to maximize similarity to the article by Sorkine-Hornung andRabinovich [2016] in order to highlight similarities in the mathematics.Author’s address: Alec Jacobson, University of Toronto, 40 St. George Street, Toronto,ON, M5S 2E4, Canada, [email protected].
We can now substitute this optimal d into our original objectivefunction: m (cid:213) i = ∥( p i − ( p i · ˆ n − c · ˆ n ) ˆ n ) − q i ∥ . (7)Rearranging terms and injecting c − c we can write this as m (cid:213) i = ∥( p i − c ) − (( p i − c ) · ˆ n ) ˆ n − ( q i − c )∥ . (8)We can thus concentrate on computing the reflection plane nor-mal ˆ n by restating the problem such that the scalar term is zero(i.e., the plane passes through the origin defining a linear reflection).Introduce the vectors from each point to the combined centroid: Step 2 x i = p i − c and y i = q i − c . (9)So now we can look for the optimal unit normal such that:ˆ n = argmin ˆ n ∈ R D , ∥ ˆ n ∥ = m (cid:213) i = ∥( x i − ( x i · ˆ n ) ˆ n ) − y i ∥ . (10) Let us expand and simplify the term in the summation of Equa-tion (10), removing constants with respect to ˆ n : ∥( x i − ( x i · ˆ n ) ˆ n ) − y i ∥ = (11) ∥ x i ∥ − x ⊤ i ˆ n ˆ n ⊤ ( x i − y i ) + x ⊤ i ˆ n ˆ n ⊤ x i + ∥ y i ∥ = (12)ˆ n ⊤ x ⊤ i y i ˆ n (up to constants) . (13)Summing over these terms our optimization problem reduces toˆ n = argmin ˆ n ∈ R D , ∥ ˆ n ∥ = ˆ n ⊤ (cid:32) m (cid:213) i = x i y ⊤ i (cid:33) ˆ n . (14)By introducing Step 3 B = m (cid:213) i = x i y ⊤ i and A = ( B + B ⊤ ) , (15)we can further reduce this problem toˆ n = argmin ˆ n ∈ R D , ∥ ˆ n ∥ = ˆ n ⊤ A ˆ n . (16)This is the variational characterization of an eigen problem. The op-timal ˆ n is the eigenvector corresponding to the smallest eigenvalue: Step 4 A ˆ n = λ min ˆ n . (17)Revisiting our derivations we can identify the five Step s necessaryto compute the best-fit affine reflection parameters ˆ n and d . REFERENCES
Olga Sorkine-Hornung and Michael Rabinovich. 2016. Least-Squares Rigid MotionUsing SVD. Technical note.2020-06-12 00:59. Page 1 of 1–1. a r X i v : . [ c s . G R ] J unun