2015-08-28 23:54:13 -0600 | answered a question | Getting camera pos/rot after SolvePnP Hello, I faced a similar situation and here is how I found the camera position and rotations : After solvePnP, we get the rotation and the translation for the object - we need to do the inverse to get the camera position and rotation. copy the rotation matrix to R, and swap the 2nd and 3rd row to swap y and z. After that, rotate the matrix by 90 degrees. This will give you the rotation matrix for the camera. Convert the rotation matrix to a quaternion. and set that to the camera rotation. As for position, where negativematrix is a matrix with 1 on the diagonals. |