Skip to main content
. 2023 Apr 21;23(8):4167. doi: 10.3390/s23084167
Algorithm 2 Least squares alignment of two 3D point sets based on SVD
1: procedure
2:     Let Y={y1,,yn} and X={x1,,xn} two sets with corresponding points.
3:     function AlignmentSVD(X,Y)
4:         y0=1ni=1nyi ▷ mean of the data point set X
5:         x0=1ni=1nxi ▷ mean of the data point set Y
6:         H=i=1n(yiy0)(xiy0)T ▷ cross covariance between X and Y
7:         UDVT=SVD(H) ▷ singular value decomposition of H
8:         R=VUT ▷ rotation matrix
9:         t=y0Rx0 ▷ translation vector
10:         T[R,t] ▷ extrinsic parameter matrix
11:         return T
12:     end function
13: end procedure