I am trying to recover an intrinsic camera K matrix to be used in OpenCV from OpenGL specifications for a camera. Almost everything that I have read on stackoverflow, etc. seems to assume that I want to take OpenGL matrices to OpenCV matrices, but my problem is the reverse. There was a previous question here but the construction of the K matrix link is dead.
Given a set of camera specifications in OpenGL:
clipping plane: { near: 0.01, far: 10.0 }
vertical field view angle (radians): 1.2
publish image resolution pixels: { width: 640, height: 480 }
I need to recover the K matrix parameters, i.e. focal lengths in the x and y directions as well as the principal point offsets.
I know that the axes conventions differ between OpenGL and OpenCV as well.