2

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 Answers1

2

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}.$$

WimC
  • 32,192
  • 2
  • 48
  • 88
  • I know this is an old answer, but I have the same problem. If you don’t mind, can you elaborate a bit more on why this solution works? – l3utterfly Jan 19 '21 at 15:13