(dataset_path)
| 7 | # TODO: don't know intrinsics |
| 8 | |
| 9 | def load_replica_gt(dataset_path): |
| 10 | results = {} |
| 11 | K = np.array([[600, 0, 599.5], [0, 600, 339.5], [0, 0, 1]]) |
| 12 | # load all image names in 'image' folder |
| 13 | image_path = dataset_path + "/image/" |
| 14 | # load gt |
| 15 | data = np.loadtxt(dataset_path + '/traj.txt') |
| 16 | N = data.shape[0] |
| 17 | for i in range(N): |
| 18 | name = 'frame{:06d}.jpg'.format(i) |
| 19 | pose = data[i, :].reshape((4, 4)) |
| 20 | # transform to world-2-camera |
| 21 | R = pose[:3, :3].T |
| 22 | t = - pose[:3, :3].T @ pose[:3, 3] |
| 23 | results[name] = { |
| 24 | "id": i, |
| 25 | "K": K, |
| 26 | "R": R, |
| 27 | "t": t, |
| 28 | "camera_id": 1 |
| 29 | } |
| 30 | return results |
| 31 | |
| 32 | def load_replica_camera(dataset_path): |
| 33 | results = {} |
no outgoing calls
no test coverage detected