-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Matcher Confidence Handling #19955
Fix Matcher Confidence Handling #19955
Conversation
@@ -768,7 +768,7 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea | |||
|
|||
// Set zero confidence to remove matches between too close images, as they don't provide | |||
// additional information anyway. The threshold was set experimentally. | |||
matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence; | |||
// matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is about the comment above of this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alalek could you re-review/approve at earliest convenience? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please share some dataset which shows the problem of this change? So we can take a look on the problem.
This code is here for eliminating of very close images (may happen on live capturing on mobile devices). Blending step with two close images provides unnecessary artifacts, so this threshold is applied here.
Ideally it would be great to provide dedicated parameter for this threshold (probably for the master branch, 3.4 is in the maintenance mode)
Per the issue #11084, we don't throw high confidence matches in
AffineBestOf2NearestMatcher
, but we do inBestOf2NearestMatcher
. In this PR, I am commenting out the line for consistency across the two feature matchers (it's currently commented out in the affine as well). An alternative idea is making this threshold configurable.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.