MATLAB: How to calculate camera projection matrix

camera imagesComputer Vision Toolboxgeometric matrix transposeprojection matrix

Hi,
I have a problem where I'm attempting to calculate the projection matrix for two c-arm images and then triangulate the position of 3 fiducial markers located within the images.
My SID = 1650 mm, pixel size = 0.388 mm, centre pixel x = 512, centre pixel y = 384, source-origin distance = 1000 mm, angle between the two projections is 90 degreees, there is no translation.
I have calculated my intrinsic matrix to be
Intrinsic = [640.2, 0, 0; 0, 640.2, 0; 512, 384, 1]
Rotation matrix to be:
Rotation = [0, -1, 0; 1, 0, 0; 0, 0, 1]
Translation matrix to be:
Translation = [0; 1000; 0]
I was hoping someone could please confirm for me that this is correct and assist me with combining these into the projection matrix to be used for triangulation.
Thanks in advance, Joel

Best Answer

See this wiki link for some reading on composing the projection matrix from intrinsics and extrinsics.
Regarding what you've shown, I think the 640.2 in your intrinsic matrix is incorrect. If the SID is 1650 mm, then in pixels it would be 1650/.388 = 4252.6. Also, more information about the extrinsics is needed, in particular how your 2D image axes are initially oriented in the first view relative to the 3D world x,y,z axes. The 90 degree rotation matrix alone does not provide this information. That just tells us how the axes change between views.
I give a solution to your triangulation example in my response to your earlier post, under some assumptions on the missing extrinsics. Note that my matrix conventions, and the conventions of the above wiki link, are different than the Computer Vision Toolbox's. I always work with upper triangular intrinsic matrices, whereas the toolbox seems to transpose everything and make it lower triangular.
Related Question