Calibration
    
    Projection Matrix
    
    $$\mathbf{w'}=P_{ps}\mathbf{X'}=P_cP_pP_r\mathbf{X'}\\
    \begin{pmatrix}su\\sv\\s\end{pmatrix}=P_{ps}\begin{pmatrix}X\\Y\\Z\\1\end{pmatrix}$$
    
    where \(P_{ps}\) is the projection matrix, \(P_r\) the rigid body transformation from real world coordinates to camera coordinates, \(P_p\) the perspective projection from camera to image plane, and \(P_c\) CCD imaging matrix from image plane to pixel coordinates. \(K=P_cP_p\), \(P_{ps}=K[R|t]\), \(M=KR\).
    
    \begin{align*}
    P_{ps}&=\begin{pmatrix}p_{11}&p_{12}&p_{13}&p_{14}\\p_{21}&p_{22}&p_{23}&p_{24}\\p_{31}&p_{32}&p_{33}&p_{34}\end{pmatrix} \\
    
    P_{r}&=\begin{pmatrix}r_{11}&r_{12}&r_{13}&T_x\\r_{21}&r_{22}&r_{23}&T_y\\r_{31}&r_{32}&r_{33}&T_z\end{pmatrix} \\
    P_{p}&=\begin{pmatrix}f&0&0\\0&f&0\\0&0&1\end{pmatrix} \\
    P_{c}&=\begin{pmatrix}k_u&0&u_0\\0&k_v&v_0\\0&0&1\end{pmatrix} \\
    \end{align*}
    
    SVD decomposition
    The projection matrix originally has 12 degrees of freedom (dof). However, \(p_{34}\) is constrainted to 1, so 11 dof left. Each correspondent gives 2 equations, so at least 6 distinct correspondents are required to solve the equation.
    
    \begin{align*}
    \begin{pmatrix}
    X&Y&Z&1&0&0&0&0&-uX&-uY&-uZ&-1\\
    0&0&0&0&X&Y&Z&1&-vX&-vY&-vZ&-1\\
    \end{pmatrix}
    \begin{pmatrix}
    p_{11}\\p_{12}\\p_{13}\\p_{14}\\p_{21}\\p_{22}\\p_{23}\\p_{24}\\
p_{31}\\p_{32}\\p_{33}\\p_{34}\\
    \end{pmatrix} = 0
    \end{align*}    
    
    
    
    
    QR decomposition
    \(A=QR\) where \(Q\) is the orthogonal matrix and \(R\) the upper triangular matrix. Please do not mix up the term \(R\).
    
    $$M=KR\rightarrow M^{-1}=R^{-1}K^{-1}$$
    
    So \(R=Q^{-1}\) and \(K = R^{-1}\).
    The translation vector is given by \(t=K^{-1}[p_{14},p_{24},p_{34}]^\top\).
    References
    
    
    - Computer Vision Single and two-view geometry pdf
 
    - Multiple View Geometry in Computer Vision