MCPcopy Create free account
hub / github.com/XiaoBaiiiiii/colmap-pcd / add_two_view_geometry

Method add_two_view_geometry

scripts/python/database.py:211–232  ·  view source on GitHub ↗
(self, image_id1, image_id2, matches,
                              F=np.eye(3), E=np.eye(3), H=np.eye(3),
                              qvec=np.array([1.0, 0.0, 0.0, 0.0]),
                              tvec=np.zeros(3), config=2)

Source from the content-addressed store, hash-verified

209 (pair_id,) + matches.shape + (array_to_blob(matches),))
210
211 def add_two_view_geometry(self, image_id1, image_id2, matches,
212 F=np.eye(3), E=np.eye(3), H=np.eye(3),
213 qvec=np.array([1.0, 0.0, 0.0, 0.0]),
214 tvec=np.zeros(3), config=2):
215 assert(len(matches.shape) == 2)
216 assert(matches.shape[1] == 2)
217
218 if image_id1 > image_id2:
219 matches = matches[:,::-1]
220
221 pair_id = image_ids_to_pair_id(image_id1, image_id2)
222 matches = np.asarray(matches, np.uint32)
223 F = np.asarray(F, dtype=np.float64)
224 E = np.asarray(E, dtype=np.float64)
225 H = np.asarray(H, dtype=np.float64)
226 qvec = np.asarray(qvec, dtype=np.float64)
227 tvec = np.asarray(tvec, dtype=np.float64)
228 self.execute(
229 "INSERT INTO two_view_geometries VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
230 (pair_id,) + matches.shape + (array_to_blob(matches), config,
231 array_to_blob(F), array_to_blob(E), array_to_blob(H),
232 array_to_blob(qvec), array_to_blob(tvec)))
233
234
235def example_usage():

Callers

nothing calls this directly

Calls 2

image_ids_to_pair_idFunction · 0.85
array_to_blobFunction · 0.85

Tested by

no test coverage detected