How to apply Ratio Test in order to remove outliers in a multiple object detection matcher?

无人久伴 提交于 2019-12-10 19:39:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!