MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / load_colmap_gt

Function load_colmap_gt

utils/readgt_colmap.py:115–143  ·  view source on GitHub ↗
(gt_path)

Source from the content-addressed store, hash-verified

113
114
115def load_colmap_gt(gt_path):
116 camera_path = gt_path + "/sparse/cameras.txt"
117 camera_df = load_camera_data(camera_path)
118
119 image_path = gt_path + "/sparse/images.txt"
120 image_df = load_image_data(image_path)
121
122 results = {}
123 for name, row in image_df.iterrows():
124 pose = row['POSE']
125 camera_id = row['CAMERA_ID']
126
127 R = quat2rot(pose['qw'], pose['qx'], pose['qy'], pose['qz'])
128 t = np.array([pose['tx'], pose['ty'], pose['tz']])
129
130 if camera_id in camera_df.index:
131 K = camera_df.loc[camera_id, 'K']
132 else:
133 K = None
134
135 results[name] = {
136 "id": camera_id,
137 "K": K,
138 "R": R,
139 "t": t,
140 "camera_id": camera_id
141 }
142
143 return results

Callers 1

5_test_ceres.pyFile · 0.90

Calls 3

load_camera_dataFunction · 0.85
load_image_dataFunction · 0.85
quat2rotFunction · 0.70

Tested by

no test coverage detected