How to get the Projection and modelview matrix from a camera's intrinsic parameters from calibrateCamera() and extrinsic parameters from solvePnP()?
I have a set of images for a camera with pictures of a person holding a checkerboard. I calibrated and calculated the intrinsic parameters like so(from following this tutorial - Python camera calibration OpenCV tutorial)
ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1],None,None)
Later I calculated the extrinsic parameters using the following.
ret2, rvecs2, tvecs2 = cv2.solvePnP(self.objp, corners2, self.intris_camera_matrix, self.intris_dist)
I am confused how I can combine these two result vectors and matrices in order to set the correct OpenGL projection matrix and ModelView Matrix. I am generally confused on the concepts as well so I would appreciate any explanation as well. I know that you need to apply Rodrigues on rvecs2 and tvecs2 to make them matrices and then do some kind of matrix operation to get the projection and modelview but I do not know what that operation is.
question from:
https://stackoverflow.com/questions/65864065/how-to-get-the-projection-and-modelview-matrix-from-a-cameras-intrinsic-paramet 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…