Ask Your Question

bfmatcher_hurts's profile - activity

2013-02-11 09:21:04 -0600 received badge  Scholar (source)
2013-02-11 09:20:58 -0600 commented answer Running into an error using cv::BFMatcher (bruteforce matcher) with 10,100 training images

Very strange. This must be it. I'm currently using the windows superpack, so I guess I'll have to go recompile my own opencv binaries, but what you wrote looks reasonable. It seems like such an odd requirement. In the meantime, I wrote my own brute-force matcher and it has no such requirements. I'm not sure why that assertion would exist. Thanks

2013-02-11 09:18:42 -0600 received badge  Supporter (source)
2013-02-11 09:18:24 -0600 commented question Running into an error using cv::BFMatcher (bruteforce matcher) with 10,100 training images

@Guanta You can cluster binary features with k-means, using hamming distance as the distance metric (you can't do that with OpenCV's k-means, but it's pretty easy to code yourself). I'm trying a few different approaches out

2013-02-08 07:36:58 -0600 received badge  Editor (source)
2013-02-07 13:22:17 -0600 asked a question Running into an error using cv::BFMatcher (bruteforce matcher) with 10,100 training images

I'm implementing a simple bag-of-words matching system, where I have 10,100 "clusters" and I am trying to match a single feature vector to the closest cluster. This works for a smaller number of clusters, but I need it to work for this larger set.

Essentially, I put all 10,100 clusters into a vector of cv::Mat objects, each of which is 1 x 16. Then, I add these to the BFMatcher as follows:

cv::BFMatcher matcher(cv::NORM_HAMMING);
bf_matcher.add(clusters_for_matching);

Finally, given a new 1 x 16 feature vector to match, I do the following:

std::vector<cv::DMatch> matches;
bf_matcher.match(feature_vector, matches);

The error I get is the following:

OpenCV Error: Assertion failed ((int64)imgCount*IMGIDX_ONE < INT_MAX) in unknown function, file ......\src\opencv\modules\features2d\src\matchers.cpp, line 360

My question is simple, what is going on and how can I make this work? It's pretty clear that for some reason it considers 10,100 to be too many training instances, but that is extremely small in comparison to some other applications.