The projection matrix is then essentially K * [R | T]
Is incorrect, actually the K Matrix is similar to projection matrix and
the R|T is called camera transform matrix or view transform matrix
Or called extrinsic matrix. So focus on the projection stuff and forget about camera transform,
what is the difference between K Matrix and Perspective Projection
Matrix(call it P Matrix later)?
- For K Matrix it transform 3D points to 2D pixels in image space.
- For P Matrix it transform 3D points to NDC space.
Take a look at two matrices:
$$K = \begin{bmatrix}f_x& 0& c_x\\ 0& f_y& c_y\\
0 & 0 & 1\\\end{bmatrix}$$
$$P = \begin{bmatrix}
\frac{1}{t*a}& 0& 0& 0\\0& \frac{1}{t}& 0& 0\\
0 & 0 & A& B&\\ 0 & 0 & -1& 0\\ \end{bmatrix}$$
$$t=tan(\frac{fovy}{2})$$
$$a=\frac{width}{height}$$
Let's add perspective divide and show the result of the above two matrices:
Intrinsic case: $$x_{2d} = \frac{x_0}{z_0 * \frac{1}{f_x}} + c_x$$
Perspective case: $$x_{2d} = \frac{x_0}{-z_0(t*a)}$$
Similar with some difference.
The image space: Origin from left-top corner
so should add Cx Cy as the offset from center to left-top corner.
And in NDC space we assume Z-axis direct out of screen so P(3,2) = -1.