# Find Orthonormal Basis for Image Plane Given Camera Matrix

Given a projection matrix $P = [M | p_4]$, ($M \in 3 \times 3$, $p_4 \in 3 \times 1$), the principal axis (the vector that passes through the center of projection and is perpendicular to the image plane) $v$ is $$v = det(M)m_3$$ where $m_3$ is the third row of $M$. Is this correct?

Now I want to find two more vectors, say $v_1$ and $v_2$, that form an orthonormal basis with $v$ and span the image plane. I know that $v_1$ and $v_2$ are not unique so I want them to be equal to the $x$- and $y$-axes once the principal axis coincides with the $z$-axis (of some world coordinate system). If the principal axis differs from the $z$-axis due to some transformation I want that same transformation to give me $v_1$ and $v_2$ if applied to the $x$- and $y$-axes. Hope you get what I mean by that!

Your requirement still does not force a unique representation: you can rotate about the $z$ axis while maintaining alignment of that axis with your principal axis. As a consequence, “that same transformation” isn't well defined. Basically you want two more vectors orthogonal to $m_3$, right? Simply compute the cross product between that axis and any vector, and the result will be orthogonal. If may be zero, so take the cross product with the three unit vectors and choose the result with maximal length as $v_1$. You can then compute $v_2=m_3\times v_1$. – MvG Nov 14 '12 at 17:54