how can i get the camera projection matrix out of calibrateCamera() return values

Srol picture Srol · Apr 19, 2013 · Viewed 19.4k times · Source

I am trying to get a 3x4 camera matrix for triangulation process but calibrateCamera() returns only 3x3 and 4x1 matrices.

How can i get the 3x4 out of those matrices?

Thanks in advance!!

Answer

Zhr Saghaie picture Zhr Saghaie · Oct 29, 2013

calibrateCamera() returns you
a 3x3 matrix as cameraMatrix,
a 4x1 matrix as distCoeffs, and rvecs and tvecs that are vectors of 3x1 rotation(R) and 3x1 transformation(t) matrices.

What you want is ProjectionMatrix, which is multiply [cameraMatrix] by [R|t]. 3D into 2D Projection

Therefore, it returs you a 3x4 ProjectionMatrix.
You can read OpenCV documentation for more info.