问题
I'm developing an iPad prototype that needs to detect multiple instances of an known object. I'm using SIFT for feature detection and descriptor extraction and BruteForce matcher.
The first problem I had to solve was how to cluster the matches in order to separate each object instance in the scene. This was done by finding the nearest matches, using two or tree steps for best results.
Now I'm working in how to reduce the outliers and I'm trying to use the Ratio Test in order to remove them. So, I have two questions here, someone could help me with them or maybe with better ways?:
1) Before, I was using the radiusMatch, but when I try to use the knnMatch (with k > 1), I receive a runtime error. Does BruteForce matcher supports knnMatcher? I didn't find anything about that.
2) How do I apply the Ratio Test with multiple instances? I mean, if I use knnMatch, I assume that I'll need to pass the k parameter with the aproximate number of expected objects instances, so, how can I apply the test with, for example, k = 20?
Reference from Mastering_OpenCV:
Ratio test The second well-known outlier-removal technique is the ratio test. We perform KNN-matching first with K=2. Two nearest descriptors are returned for each match. The match is returned only if the distance ratio between the first and second matches is big enough (the ratio threshold is usually near two).
Tks
来源:https://stackoverflow.com/questions/18710060/how-to-apply-ratio-test-in-order-to-remove-outliers-in-a-multiple-object-detecti