flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.25k stars 647 forks source link

Poor performance compared to BBF-style match #189

Closed davidmarianovak closed 10 years ago

davidmarianovak commented 10 years ago

Hello

I would like to know whether FLANN supports a matching approach similar to the one described in "Beis, J. S. and Lowe, D. G. Shape indexing using approximate nearest-neighbor search in high-dimensional spaces". I have been using OpenSIFT's NN-matching, which implements the mentioned paper, and it produces satisfying results. I've tried to use FLANN but the results are poor.

This is the matching result using OpenSIFT's NN-matching:

http://www.hypothraxer.net/downloads/Matches_BBF.jpg

and this is the result with FLANN:

http://www.hypothraxer.net/downloads/Matches_FLANN.jpg

I'm using FLANN's randomized kdtree's with 16 parallel trees. I've set the search parameters to 200. The code, with images, can be downloaded here:

http://www.hypothraxer.net/downloads/FLANN_Test.7z

Any help as to why FLANN performs so poorly would be greatly appreciated.

mariusmuja commented 10 years ago

The issue seems to be that the OpenSIFT's NN-matching is altering the features (or the feature order). If you comment the OpenSIFT NN matching, you should obtain the expected results from FLANN.

You also should be able to use fewer trees and checks (there are not that many features in this example).

davidmarianovak commented 10 years ago

Cheers for the speedy reply! It was indeed the reordering. I was a bit confused because the OpenCV implementation of SIFT extraction & matching obtains similar, strange results. But it turns out that the SIFT-extraction of OpenCV is to blame and not FLANN (It extracts a lot less keypoints than OpenSIFT). Thanks again!