Calculate the camera position in the world coordinate system.
(QW, QX, QY, QZ, TX, TY, TZ)
| 33 | return R |
| 34 | |
| 35 | def calculate_camera_position(QW, QX, QY, QZ, TX, TY, TZ): |
| 36 | """ |
| 37 | Calculate the camera position in the world coordinate system. |
| 38 | """ |
| 39 | R = quaternion_to_rotation_matrix(QW, QX, QY, QZ) |
| 40 | R_t = R.T |
| 41 | T = np.array([TX, TY, TZ]) |
| 42 | camera_position_world = -R_t.dot(T) |
| 43 | return camera_position_world |
| 44 | |
| 45 | def rotation_matrix_to_euler_angles(R): |
| 46 | """ |
no test coverage detected