Using FLANN with binary descriptors (Brief,ORB)
I am trying to use FLANN with binary descriptors (brief, orb) with no luck. My code looks something like this:
vector<vector<KeyPoint> > dbKeypoints;
vector<Mat> dbDescriptors;
vector<Mat> objects;
/*
load Descriptors from images (with OrbDescriptorExtractor())
*/
FlannBasedMatcher matcher;
matcher.add(dbDescriptors);
matcher.train() //> Crash! (or any call to matcher.match())
If I use SurfDescriptorExtractor()
it works well.
How can I solve this?
OpenCV says:
OpenCV Error: Unsupported format or combination of formats (type=0
) in unknown function, file D:\Value\Personal\Parthenope\OpenCV\modules\flann\sr
c\miniflann.cpp, line 299
(Note: i have posted the same question on stackoverflow)
I have found an hacky solution but i think it's not so good here
Basically the author before adding to FLANN converts the binary descriptors to CV_32F. But i don't think it's good beacuse distance must be calculated with HAMMING distance, and not euclian distance with float values.
I don't think that the FLANN library can do well with Hamming distances. Locality-sensitive hashing may be more suitable for your case.
@angel: Yes I have tried LSH but the software crashes. Maria said there is a bug