[Feature] expose charuco detection parameters#37
Merged
Robertleoj merged 5 commits intoJun 24, 2026
Merged
Conversation
Note that: In [1]: import numpy as np In [2]: a = np.array([[1]]) In [3]: a.squeeze() Out[3]: array(1) # and a.squeeze().shape == () This breaks in Frame postinit (shape[0] access) We want: In [4]: a.squeeze(1).shape Out[4]: (1,)
This allows you to configure various parts, but will use default settings from OpenCV if not passed. Note: This changes the default behavior to `minMarkers = 2` (opencv default). In my experience, the extra detections with `minMarkers = 1` are not high quality. For our data this seems to work well: ```python detector_april = cv2.aruco.DetectorParameters() detector_april.cornerRefinementMethod = cv2.aruco.CORNER_REFINE_APRILTAG charuco_best = cv2.aruco.CharucoParameters() charuco_best.minMarkers = 2 # default, but explicit charuco_best.tryRefineMarkers = True # I have not done a lot here - so there might be better options refine_parameters = cv2.aruco.RefineParameters() ``` Note: these are RGB cameras, non-fisheye I exhaustively tried many different combinations and then used 5-fold cross-validation in the calibrations to see which methods tend to work best (though I guess this will really depend on the camera/environment/board) in general. Note that the direct results from the calibration can't be directly compared as the different settings will lead to different numbers of outliers - and you can improve the score by rejecting more outliers (read: overfitting).
Owner
|
Thanks for the PR! I'm going to leave the |
Closed
Contributor
Author
|
Yeah, I figured you might want to have it like that. Now at least it is easy to configure :) |
JRombouts
commented
Jun 24, 2026
| ) -> Frame | None: | ||
|
|
||
| charuco_params = ( | ||
| cv2.arcuo.CharucoParameters() |
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
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.
This allows you to configure various parts, but will use default
settings from OpenCV if not passed.
Note: This changes the default behavior to
minMarkers = 2(opencvdefault). In my experience, the extra detections with
minMarkers = 1are not high quality.
For our data this seems to work well:
Note: these are RGB cameras, non-fisheye
I exhaustively tried many different combinations and then used 5-fold
cross-validation in the calibrations to see which methods tend to work
best (though I guess this will really depend on the
camera/environment/board) in general.
Note that the direct results from the calibration can't be directly
compared as the different settings will lead to different numbers of
outliers - and you can improve the score by rejecting more outliers
(read: overfitting).
Builds on #36