Closed Zumbalamambo closed 4 years ago
What do you mean with pair? Do you want to extract the features for two images?
@humenbergerm yes , I would like to extract the features for two images :)
So why don't you just call extract.py? See readme:
To extract keypoints for a given image, simply execute:
python extract.py --model models/r2d2_WASF_N16.pt --images imgs/brooklyn.png --top-k 5000
This also works for multiple images (separated by spaces) or a .txt image list. For each image, this will save the top-k keypoints in a file with the same path as the image and a .r2d2 extension. For example, they will be saved in imgs/brooklyn.png.r2d2 for the sample command above.
Sorry, I did not include a script for testing on a given image pair.
Once you have the descriptors (as @humenbergerm said just above) you can follow the standard OpenCV matching pipeline (many demos are available like this one). Basically, matching descriptors using brute-force matching (cv2.BFMatcher(crossCheck=True)
), filtering with RANSAC (cv2.findHomography()
) and displaying them.
Hello authors.
To find matches, it is a simple L2 similarity right? Which feature matcher would you recommend? Do you recommend the cv2.BFMatcher(cv2.NORM_L2, crossCheck=True). Or can I expect the same performance using the mnn_matcher
from HPatches-Sequences-Matching-Benchmark.ipynb ?
As a related query, will a dot product between the two feature descriptors give their similarity (i.e. higher the output, more similar are the features)
Thanks
Hi!
Yes, L2 similarity can be used. Note that the descriptors are L2 normalized, so the dot product works as well. Please check-out this code: https://github.com/naver/kapture-localization/blob/main/tools/kapture_compute_matches.py
Our "kapture" / "kaputure-localization" repos might help as well for other questions: https://github.com/naver/kapture ; https://github.com/naver/kapture-localization
I hope this helps! Best, Martin
Hi!
Yes, L2 similarity can be used. Note that the descriptors are L2 normalized, so the dot product works as well. Please check-out this code: https://github.com/naver/kapture/blob/master/tools/kapture_compute_matches.py
Our "kapture" repo might help as well for other questions: https://github.com/naver/kapture
I hope this helps! Best, Martin
The link to the compute matches
file is broken. Can you please provide the updated path?
compute matches was moved to the kapture-localization repository. I edited the answer above.
How do I test the code on a single pair of images?