Singular values in Kabsch algorithm

934 Views Asked by At

I've implemented Kabsch algorithm to compute an optimal rotation matrix between two sets of points. And while calculating the SVD $P^TQ =U \Sigma V^*$, I've noticed a pattern.

Whenever I calculate the rotation between two sets of each $3$ points, I only end up having $2$ singular values. Whenever I calculate the rotation between two sets of each $2$ points, I only get $1$ singular value. And if I compute the rotation of more than $3$ points, I get all $3$ singular values.

I understand, that $2$ points are too little to compute a unique rotation. The rotation still has one degree of freedom. So it's not a surprise, that the middle matrix $\Sigma$ doesn't have a full rank.

But with $3$ points, the optimal rotation is unique. So why do I only end up with $2$ singular values? Is there an obvious thing that I'm missing?

1

There are 1 best solutions below

0
On BEST ANSWER

You didn't use the original $P$ and $Q$ when calculating the SVD. You first subtracted the mean point from all the points in each set. This action actually reduced the rank of $P$ and $Q$ from 3 to 2 (assuming $P$ and $Q$ were $3\times 3$ matrix). If 3 points are centered by the origin then any one of them is a linear combination of the other two. let's say that $p1=(x1,y1,z1)$, $p2=(x2,y2,z2)$ then you already know the cooridnates of $p3$. Since the 3 points are centered by the origin, you must have $p3=(-x1-x2,-y1-y2,-z1-z2)$. Therefore the rank of the points is 2 (the same with $Q$).

Therefore the covariance matrix that you sent to SVD was of rank 2 which led to rank 2 in $\Sigma$ (which led to 2 singular values).

But you still have one unique rotation matrix (except for some special cases) since 3 pair of points are enough for calculating the 3 angles of rotation.