Feature Matching with FLANN sample code bug (Bugfix #3071)
Description
The sample code on this page has a pretty big problem that is easily fixed.
http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html
If min_dist is 0, then 2*min_dist is still 0, so perfectly good points get rejected, causing match failure.
My quick fix was to add this code:
if (minDist < 4)
minDist = 4;
However, I think it does not make sense to use a single extreme point (min_dist) for this decision. Something like the median distance plus 20% would be more robust.
Associated revisions
Fixes bug #3071.
If we have perfect matches (min_dist == 0.0), then strict comparison
fails. Making it non-strict results in treating perfect matches as
good.
Merge pull request #3071 from mshabunin:stitch-fix
History
Updated by Daniil Osokin almost 12 years ago
Hi, Steve!
Thank you for attention! Please, send a pull request with bugfix (http://code.opencv.org/projects/opencv/wiki/How_to_contribute). It will speedup fixing in many times.
- Target version set to 2.4.6
Updated by Daniil Osokin almost 12 years ago
- Assignee changed from Vadim Pisarevsky to Steve Coppola
Updated by Sergei Nosov over 11 years ago
- Assignee changed from Steve Coppola to Sergei Nosov
Updated by Vladislav Vinogradov over 11 years ago
- Pull request set to https://github.com/Itseez/opencv/pull/988
Updated by Kirill Kornyakov over 11 years ago
- Status changed from Open to Done
- Tracker changed from Bug to Bugfix