How to find the best-fit transformation between two sets of 3D observations

1.9k Views Asked by At

Let us assume that I have two sets of observations, A and B. Each of them is a list of 3D points. They describe the same set of world 3D points at the same order. However, they are given in different coordiante systems (so that they might be different in rotation, translation and scale), and they also contain noise so there's no "perfect" fit between them. What would be the best way to find a transformation between them such that the transformed version of B would minimize the least-squares difference from A?

1

There are 1 best solutions below

1
On

Long answer short: Let $A =(a_1, a_2, \ldots, a_n)$ and $B=(b_1, b_2, \ldots, b_n)$. Define the centroids $$\overline{a}=\frac{1}{n}\sum_{k=1}^na_k$$ $$\overline{b}=\frac{1}{n}\sum_{k=1}^nb_k$$ and matrices (where each $a_k$ and $b_k$ is considered a column vector) $$P=\left(\frac{1}{n}\sum_{k=1}^nb_k\,b_k^t\right)-\overline{b}\,\overline{b}^t$$ $$Q=\left(\frac{1}{n}\sum_{k=1}^na_k\,b_k^t\right)-\overline{a}\,\overline{b}^t$$ Then the map with a least squares fit is $$b\mapsto QP^{-1}(b-\overline{b}) + \overline{a}.$$