[Math] Find unique 3D affine transformation between two sets of points

geometryhomogeneous-spaceslinear-transformations

Suppose I have one set of points and one set of transformed points in 3D space. How many sample points in both 3D sets do I need to compute the unique affine transformation? My considerations are as follows: In 3D space, I can represent an affine transformation in homogeneous coordinates by a $4\times4$ matrix $T$ where 12 variables (9 for rotation and 3 for translation) are unknown. Therefore, I need 4 points in each set and solving $TP=P'$, where $P$ and $P'$ are the respective matrices containing the sampled point positions, would yield a unique solution. Is that correct?

Best Answer

Affine transformation includes scaling (which is 3 scaling values + 3 degrees of freedom determining the directions of scaling). However, for rotation you need only 3 degrees of freedom. So you answer is correct: 4 points not lying at the same plane are enough.

You can think it that way: let's have points $p_0,\ldots p_3\to q_0,\ldots q_3$. Then if we can express any other point $p=p_0+\alpha(p_1-p_0)+\beta(p_2-p_0)+\gamma(p_3-p_0)$ by linearity of the affine transformation it would go to $q=q_0+\alpha(q_1-q_0)+\beta(q_2-q_0)+\gamma(q_3-q_0)$.