Skip to content

Commit 1252817

Browse files
authored
Bugfix for the migration to pycolmap.Database. (cvg#480)
1 parent 374799c commit 1252817

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

hloc/reconstruction.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ def import_images(
5353
def get_image_ids(database_path: Path) -> Dict[str, int]:
5454
images = {}
5555
with open_colmap_database(database_path) as db:
56-
images = {
57-
image.name: image_id for image_id, image in db.read_all_images().items()
58-
}
56+
images = {image.name: image.image_id for image in db.read_all_images()}
5957
return images
6058

6159

@@ -180,8 +178,7 @@ def main(
180178
skip_geometric_verification,
181179
)
182180
if not skip_geometric_verification:
183-
with open_colmap_database(database) as db:
184-
estimation_and_geometric_verification(db, pairs, verbose)
181+
estimation_and_geometric_verification(database, pairs, verbose)
185182
reconstruction = run_reconstruction(
186183
sfm_dir, database, image_dir, verbose, mapper_options
187184
)

hloc/triangulation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ def main(
222222
)
223223
if not skip_geometric_verification:
224224
if estimate_two_view_geometries:
225-
with open_colmap_database(database) as db:
226-
estimation_and_geometric_verification(db, pairs, verbose)
225+
estimation_and_geometric_verification(database, pairs, verbose)
227226
else:
228-
geometric_verification(
229-
image_ids, reference, database, features, pairs, matches
230-
)
227+
with open_colmap_database(database) as db:
228+
geometric_verification(
229+
image_ids, reference, db, features, pairs, matches
230+
)
231231
reconstruction = run_triangulation(
232232
sfm_dir, database, image_dir, reference, verbose, mapper_options
233233
)

0 commit comments

Comments
 (0)