-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Fix contour filtering in ArUco #24479
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also there are build warnings. |
4 tasks
asmorkalov
reviewed
Nov 2, 2023
14a3698
to
25d36b4
Compare
AleksandrPanov
commented
Nov 7, 2023
AleksandrPanov
commented
Nov 7, 2023
AleksandrPanov
commented
Nov 7, 2023
AleksandrPanov
commented
Nov 7, 2023
cebbfbf
to
a79cef7
Compare
asmorkalov
reviewed
Nov 8, 2023
a79cef7
to
574fd08
Compare
asmorkalov
reviewed
Nov 9, 2023
579aaf1
to
84590f9
Compare
asmorkalov
approved these changes
Nov 9, 2023
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.
👍
6 tasks
Merged
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #24220
Merge with opencv/opencv_extra#1117
Prepared new filtering algorithm for ArUco. This algorithm fixes:
Also:
Tested new filtering algorithm for ArUco in synthetic benchmark with marker length rate = 0.8
ArucoDetector apply several AdaptiveThreshold() with different params to improve contour detect in different conditions. This generates a series of contours that need to be filtered out:

The previous version of
_filterTooCloseCandidates
groups close contours and saves as candidate only one larger contour in group (or smaller contour in inverted marker case).The new version of
filterTooCloseCandidates
groups close contours and saves as candidate one larger contour, and additionally saves several candidates located far enough away as "close candidates" (the average distance between any two saved markers greater than minGroupDistance*moduleSizeInPixels).Also a hierarchy is also defined between the contours. First, the child contours are processed, then the parent ones. A contour containing an Aruco marker cannot be an Aruco marker and this contour is skipped.
TODO: remove old filter fix in QR code detect in next PR
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.