# Intrinsic camera matrix from blender

In Blender I can render an animation by a camera with specific camera intrinsic settings:

Say I generate images of size 640x480, then the intrinsic matrix K becomes

$\large K = \begin{bmatrix} \alpha & 0 & u_c \\ 0 & \beta & v_c \\ 0 & 0 & 1\end{bmatrix}$

where

$\LARGE \alpha = \frac{\text{focal length} \cdot \text{sensor width}}{ \text{image width} }$

and similar with beta for sensor height and image height. uc,vc are center points of the image.

Now, from blender I can get the camera Rotation-Translation matrix RT which basically describes the cameras trajectory and rotation within the synthetic world.

Now, I can map from image coordinates to world coordinates back and forth:

$\large x_{world} = RT^{-1} \cdot K^{-1} \cdot \begin{bmatrix} u \cdot d \\ v \cdot d \\ d \\ 1 \end{bmatrix}, \quad d=\text{depth}$

The issue here is, that I get an projection error that is quite large. That means, if I project the left-upper corner u = 0, v = 0 to world coordinates, then x_world is close to the true destination but not quite. If I manipulate the focal length in K then I can adjust the projection a little bit in a positive way but this seems hacky.

Has anyone ideas or thoughts on this? Thanks

• "close but not quite" is not very descriptive. It it's small enough - could be just a floating point arithmetic problem. What is the reprojection error in pixels? You should have it very close to zero, if not, there is a problem with the way you project/backproject. If it is fine, you need to give more details on how exactly you compute external matrix, depth and how you check that your left corner is not where it should be. – Noidea Nov 15 '16 at 22:00