Creating OpenGL's perspective projection matrix from calibrated parameters

asked 2014-02-27 11:02:44 -0500

sub_o gravatar image

updated 2014-02-28 00:38:52 -0500

berak gravatar image

Hi everyone,

I have calibrated intrinsic parameters, i.e. fx, fy, cx, cy. And I wanted to create perspective projection matrix for OpenGL. Normally in OpenGL you would either call glFrustum which follows the similar matrix below, or glm::perspective function if you're using GLM.

However, when I look into how perspective projection matrix on OpenGL are created, it doesn't factor in focal points and camera's principal points. How should I modify the matrix in order to consider those intrinsic parameters?

image description

In the end I'd like to create a MVP (model view projection) matrix by doing MVP = projection * view * model. With model's translation and rotation matrix obtained from solvePnP, thus. model = inverse( translation * rotation ) ,

Any idea on how should I create the perspective projection matrix?

edit retag flag offensive close merge delete