ubc-vision / image-matching-benchmark

Public release of the Image Matching Benchmark: https://image-matching-challenge.github.io
https://image-matching-challenge.github.io
Apache License 2.0
527 stars 93 forks source link

Feature/pairwise matching #42

Closed ducha-aiki closed 3 years ago

ducha-aiki commented 3 years ago

Allow pairwise methods like Patch2pix, loftr, etc for the stereo track.

One needs to save matching pairwise "keypoints" in h5 files in the following format:

src_pts, dst_pts = match_pairwise(img1, img2)
keypoints['img1-img2'] = src_pts
keypoints['img2-img1'] = dst_pts

So instead of the default version, where keypoints.h5 contains N items, one per image, now it should contain 2N(N-1) items, two per image pair.

The matches.h5 file should contain the indexes of the matching keypoints as usual, which in this case means [arange(num_kpts), arange(num_kpts)]

In the config.json, section config_common should contain the following entries:

      "num_keypoints": -1,
      "pairwise_keypoints": true

This works only for stereo.

ducha-aiki commented 3 years ago

ToDo: update the ReadMe and tutorial example.

The valid example code is here: https://github.com/ducha-aiki/imc2021-sample-kornia-submission/blob/master/extract_loftr_matches.py