(qw, qx, qy, qz)
| 5 | |
| 6 | # The reconstructed pose of an image is specified as the projection from world to the camera coordinate |
| 7 | def quat2rot(qw, qx, qy, qz): |
| 8 | R = np.array([ |
| 9 | [1 - 2 * (qy**2 + qz**2), 2 * (qx * qy - qz * qw), 2 * (qx * qz + qy * qw)], |
| 10 | [2 * (qx * qy + qz * qw), 1 - 2 * (qx**2 + qz**2), 2 * (qy * qz - qx * qw)], |
| 11 | [2 * (qx * qz - qy * qw), 2 * (qy * qz + qx * qw), 1 - 2 * (qx**2 + qy**2)] |
| 12 | ]) |
| 13 | return R |
| 14 | |
| 15 | def load_camera_data(file_path): |
| 16 | with open(file_path, 'r') as file: |