CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
add dynamic window in aruco cornerRefinement #24355
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
add dynamic window in aruco cornerRefinement #24355
Conversation
2438a78
to
6b1e3b0
Compare
* In the case of markers located far from each other, it may be useful to increase the value of the parameter to 0.4-0.5. | ||
* In the case of markers located close to each other, it may be useful to decrease the parameter value to 0.1-0.2. | ||
*/ | ||
CV_PROP_RW float minCornerRefinementWinSizeInPin; |
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.
I propose to name the field as relativeCornerRefinmentWinSize
. And add information about avarage Aruco pin size and logic to the description.
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.
renamed to relativeCornerRefinmentWinSize
:
/** @brief minimum allowed window size for the corner refinement process (in pins of ArUco marker) (default 0.3).
*
* cornerRefinementWinSize is recalculated for each marker as:
* cornerRefinementWinSize = min(cornerRefinementWinSize, averageArucoModuleSize*relativeCornerRefinmentWinSize),
* where averageArucoModuleSize is average module size of ArUco marker in pixels.
* (ArUco marker is composed of black and white modules)
* In the case of markers located far from each other, it may be useful to increase the value of the parameter to 0.4-0.5.
* In the case of markers located close to each other, it may be useful to decrease the parameter value to 0.1-0.2.
*/
CV_PROP_RW float relativeCornerRefinmentWinSize;
6b1e3b0
to
663f4ba
Compare
663f4ba
to
fd4af21
Compare
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.
👍
@AleksandrPanov what is the peak at 10px? |
@victor1234, all markers detected with an error of 10 pixels or more are marked as undetected. These markers make a peak of 10 pixels. The error calculate as the Chebyshev distance between the gold marker and the detected marker. |
I would say that mean error (=1px) on synthetic data for subpixel method is high. And outliers with error > 1 are also look strange. Do you know the reason? |
Several groups of images are blured. Also the benchmark adds color noise on top of the image like pepper-solt augmentation. Current hypothesis is related to this. We make experiments right now and analyze the detector code to prove it. |
Fixes #24113
cornerRefinementMethod=CORNER_REFINE_SUBPIX does not work correctly with markers that are too close to each other.
Now
cornerRefinementWinSize
is recalculated for each marker as:cornerRefinementWinSize = min(cornerRefinementWinSize, averageArucoPinSize*relativeCornerRefinmentWinSize)
relativeCornerRefinmentWinSize=0.3 by default and could be changed
Also the method has been tested by the benchmark, 289 aruco boards like this were tested:
command line to generate and run (also need set cornerRefinementMethod: 1 and cornerRefinementWinSize: 10 in aruco_params.yml):
tested with cornerRefinementWinSize=10

error in pixels with old cornerRefinementMethod:
mean detected error in pixels 5.912010732442689
error in pixels with new cornerRefinementMethod:

mean detected error in pixels 0.991642490414958
command line to show histogram:
new.json.txt
old.json.txt
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.