5,336
edits
Line 61: | Line 61: | ||
==Determining rotation <math>\mathbf{R}</math> and translation <math>\mathbf{t}</math>== | ==Determining rotation <math>\mathbf{R}</math> and translation <math>\mathbf{t}</math>== | ||
Theorem: A <math>3 \times 3</math> real matrix can be factored into a product of a rotation matrix and a non-zero skew symmetric matrix iff <math>Q</math> is two equal non-zero singular values and one zero singular value. | Theorem: A <math>3 \times 3</math> real matrix can be factored into a product of a rotation matrix <math>R</math> and a non-zero skew symmetric matrix <math>S</math> iff <math>Q</math> is two equal non-zero singular values and one zero singular value. | ||
Let the singular value decomposition of our essential matrix <math>Q</math> be | Let the singular value decomposition of our essential matrix <math>Q</math> be <math>U D V^T</math> where <math>D = \operatorname{diag}(k, k, 0)</math>. | ||
Let <math>E = \begin{pmatrix} | |||
0 & 1 & 0\\ | |||
-1 & 0 & 0\\ | |||
0 & 0 & 1 | |||
\end{pmatrix}</math> | |||
and | |||
<math>Z = \begin{pmatrix} | |||
0 & -1 & 0\\ | |||
1 & 0 & 0 \\ | |||
0 & 0 & 0 | |||
\end{pmatrix}</math> | |||
Then we have the following: | |||
* <math>S = V Z V^T</math> | |||
* <math>R = U E V^T</math> or <math>U E^T V^T</math> | |||
* <math>Q = RS</math> | |||
;Notes | |||
* Here, <math>R</math> is your rotation and <math>S = [T]_{\times}</math> | |||
* <math>T = V (0, 0, 1)^T</math>, the third column of <math>V</math> or third row of <math>V^T</math> | |||
* Some sources such as Wikipedia use <math>[T]_{\times} = U Z U^T</math> and <math>T = U (0, 0, 1)^T</math>. | |||
** This is equivalent to <math>RT</math> in our notation. | |||
* Since <math>V</math> is orthonormal, this give <math>\Vert T \Vert = 1</math> | |||
* Note <math>-RT = -UEV^T V(0,0,1)^T = -U(0,0,1)^T</math> | |||
We have two possibilities for <math>R</math> and <math>T</math>: | |||
* <math>R = U E V^T</math> or <math>U E^T V^T</math> | |||
* <math>T = V (0, 0, 1)^T</math> or <math>-V (0, 0, 1)^T</math> | |||
This gives us 4 possibilities for <math>P'</math> | |||
* <math>P' = (UEV^T | -U(0,0,1)^T</math> | |||
* <math>P' = (UEV^T | U(0,0,1)^T</math> | |||
* <math>P' = (UE^TV^T | -U(0,0,1)^T</math> | |||
* <math>P' = (UE^TV^T | U(0,0,1)^T</math> | |||
For planar images, only one of these 4 options is feasible. | |||
You can determine which one is feasibly using triangulation with one of your points. | |||
In the implausible 3 possibilities, <math>P'\mathbf{u}</math> will be out of bounds or negative | |||
==3D points== | ==3D points== |