I am basically extracting many keypoints with SURF from similar images and adding them to the
BFMatcher(NORM_L2)
After I have calculate all descriptors from my keypoints and I have a
Mat descriptors;
I had them to the matcher->add(descriptors);
Now when I have added only a few of images, all works fine, but at some point when I try to:
matcher->knnMatch(queryDesc,matches,2);
I get a vector with 0 Nearest-neighbour. If i do:
for(auto i = 0; i <matches.size(); i++) {
cout << "matches size: "<<matches[i].size()<<endl;
I get printed
"matches size: 0"
"matches size: 0"
"matches size: 0"
...
This happens only when I have inserted more than 20-30 images. Before the knnMatch works fine.
What it could be? (Version 2.4.5) I have tried with SIFT and it happens the same thing