prash_prash

08-23-2011, 06:58 AM

Hello,

I need help in constructing Projection Matrix from Camera Calibration data.

I have rendered a scene after setting the perspective using gluPerspective() with some values after few trial and errors...and I am able to get a pretty decent rendering.

However I would like to get the 'correct' rendering using the camera calibration file data.

In that file, the Intrinsic Matrix [3x3] is given as:

1914.070000 0.343703 564.645000

0.0 1918.500000 428.422000

0.0 0.0 1.0

Also the Rotation Matrix from the camera is as follows:

0.989230 0.003946 0.146295 -7.784865

-0.004391 0.999983 0.002724 -0.431597

-0.146283 -0.003337 0.989230 1.392058

My question is:

How can I create a projection Matrix [4x4], projMatrx which I can use as an argument to

glMatrixMode(GL_PROJECTION);

glLoadMatrixd(projMatrx);

I looked at lots of resources for the matrix calculations, but cannot figure out how do I get [4x4] from these values.

I am sure it is a routine thing for the experts out there..please help me out here.

I need help in constructing Projection Matrix from Camera Calibration data.

I have rendered a scene after setting the perspective using gluPerspective() with some values after few trial and errors...and I am able to get a pretty decent rendering.

However I would like to get the 'correct' rendering using the camera calibration file data.

In that file, the Intrinsic Matrix [3x3] is given as:

1914.070000 0.343703 564.645000

0.0 1918.500000 428.422000

0.0 0.0 1.0

Also the Rotation Matrix from the camera is as follows:

0.989230 0.003946 0.146295 -7.784865

-0.004391 0.999983 0.002724 -0.431597

-0.146283 -0.003337 0.989230 1.392058

My question is:

How can I create a projection Matrix [4x4], projMatrx which I can use as an argument to

glMatrixMode(GL_PROJECTION);

glLoadMatrixd(projMatrx);

I looked at lots of resources for the matrix calculations, but cannot figure out how do I get [4x4] from these values.

I am sure it is a routine thing for the experts out there..please help me out here.