Open YouyangShen opened 2 years ago
The error message seems unrelated to the issue that you link. Can you please add a breakpoint in import_matches
and check that the matches are correct?
https://github.com/cvg/Hierarchical-Localization/blob/e8ea8a25b297bae2e058abfb294335219d9f55ad/hloc/triangulation.py#L75-L79
You can also compute statistics on the number of keypoints and matches per image or read the database to check the matches:
from hloc.utils.viz import plot_images, plot_matches
from hloc.utils.database import COLMAPDatabase, pair_id_to_image_ids, blob_to_array
db = COLMAPDatabase.connect('path/to/database.db')
keypoints = {
i: blob_to_array(data, np.float32, (r, c))[:, :2]
for i, r, c, data in db.execute('SELECT * FROM keypoints')}
matches = {
pair_id_to_image_ids(pid): blob_to_array(data, np.uint32, (r, c)
for pid, r, c, data in db.execute('SELECT pair_id, rows, cols, data FROM two_view_geometries')
if data is not None}
for id0, id1 in list(matches)[::5][:10]:
assert id1 > id0
m = matches[id0, id1]
plot_images([read_image(image_dir / rec.images[i].name) for i in (id0, id1)], titles=[len(m), ''])
plot_matches(keypoints[id0][m[:, 0]], keypoints[id1][m[:, 1]])
Hi, @Skydes. I am trying my own feature extractor and matcher on Aachen dataset by following the pipeline. When I run triangulation, I have this problem as below: I look it up in the issues and you labeled this as a bug in https://github.com/cvg/Hierarchical-Localization/issues/20#issuecomment-694864147. In the messages below, while it run triangulation, it load 0 matches. Do you have any idea how to fix it?