Skip to content

Fix Matcher Confidence Handling#19955

Closed
danielenricocahall wants to merge 3 commits intoopencv:3.4from
danielenricocahall:fix-matcher-thresholding
Closed

Fix Matcher Confidence Handling#19955
danielenricocahall wants to merge 3 commits intoopencv:3.4from
danielenricocahall:fix-matcher-thresholding

Conversation

@danielenricocahall
Copy link
Copy Markdown
Contributor

@danielenricocahall danielenricocahall commented Apr 21, 2021

Per the issue #11084, we don't throw high confidence matches in AffineBestOf2NearestMatcher, but we do in BestOf2NearestMatcher. 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

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

// 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;
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Copy Markdown
Contributor Author

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!

Copy link
Copy Markdown
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants