Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Creating OpenGL's perspective projection matrix from calibrated parameters

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?

click to hide/show revision 2
retagged

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

berak gravatar image

Creating OpenGL's perspective projection matrix from calibrated parameters

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?