Hierarchical-Localization
Hierarchical-Localization copied to clipboard
Localizing Query and saving its output in bin files
Hi,
Thanks for the support this community has provided. I would like to ask, when I use localize_sfm.main()
to find my query within a mapping dataset, how can I save the outputs in a format that can be accessed by colmap-gui? I would like this so that I can visualize the matching results and their correspondences between the query and mapping images.
I would like to generate the files (points3D.bin, images.bin, cameras.bin, database.db) with localize_sfm.main()
in the same way as triangulation.main()
and reconstruction.main()
does for us.
Thanks for your guidance!~
You can read the output text file and create a COLMAP model from scratch using pycolmap:
rec = pycolmap.Reconstruction()
camera_id = 1
cam1 = pycolmap.Camera(model_name, w, h, params, camera_id)
rec.add_camera(cam1)
im1 = pycolmap.Image(image_name, [], tvec, qvec, camera_id, id=1)
rec.add_image(im1)
rec.write("path/")
This could be a useful feature - feel free to open a PR for it.