Focal length scaling factor

I am trying to do transformation from pybullet simulation to image plane using the view matrix and projection matrix. I on the last step of transforming the projected pixel from clipped space to image plane, using the glviewport. However, i keep getting my focal length to be .235 from the projection matrix which is why my transformed points keep moving within a small box. Is there a magnification ratio applied to the focal length? How do i get the correct focal length?