MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / read_intrinsics_text

Function read_intrinsics_text

scene/colmap_loader.py:144–166  ·  view source on GitHub ↗

Taken from https://github.com/colmap/colmap/blob/dev/scripts/python/read_write_model.py

(path)

Source from the content-addressed store, hash-verified

142 return xyzs, rgbs, errors
143
144def read_intrinsics_text(path):
145 """
146 Taken from https://github.com/colmap/colmap/blob/dev/scripts/python/read_write_model.py
147 """
148 cameras = {}
149 with open(path, "r") as fid:
150 while True:
151 line = fid.readline()
152 if not line:
153 break
154 line = line.strip()
155 if len(line) > 0 and line[0] != "#":
156 elems = line.split()
157 camera_id = int(elems[0])
158 model = elems[1]
159 assert model == "PINHOLE", "While the loader support other types, the rest of the code assumes PINHOLE"
160 width = int(elems[2])
161 height = int(elems[3])
162 params = np.array(tuple(map(float, elems[4:])))
163 cameras[camera_id] = Camera(id=camera_id, model=model,
164 width=width, height=height,
165 params=params)
166 return cameras
167
168def read_extrinsics_binary(path_to_model_file):
169 """

Callers 1

readColmapSceneInfoFunction · 0.90

Calls 1

CameraClass · 0.85

Tested by

no test coverage detected