-
-
Notifications
You must be signed in to change notification settings - Fork 55.8k
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
Charuco board detection is not suitable for calibration? #23873
Comments
66666 |
@viktor1234 could you attach the original sample image? |
@victor1234 Thanks a lot for the issue report! It's definitely critical issue for ChAruco detector and calibration. Will try to solve it ASAP. Also big thanks for the original image! Could you provide ChaRuco board parameters: dictionary, geometry parameters, etc? |
"markerLength": 0.2540, You are welcome. |
The code was migrated from opencv_contrib and we are actively working on its stabilization. |
@victor1234, I found the problem. You are using the deprecated ChArUco template. Just add this code to fix your problem:
Charuco templates was updated in opencv/opencv_contrib#3174. The behavior has changed only for templates with an even number of rows. This was done to make the ChArUco patterns compatible with the chessboard. Also OpenCV team tested CharucoDetector with another camera: |
Thanks. Will check in days. |
@victor1234, any updates? |
Legacy parameter helped. |
@victor1234 Thanks for the feedback. We are looking on options how to rework Charuco pipeline and data with corner cases will be useful. Could you share some images with us? |
|
I would say that the cornerHarris should be an integrated part of any charuco detector pipeline when using detections for camera calibration. It is fundemental to place detected corners as precise as possible, based on the information in the pixel values, not by reprojections as we otherwise might introduce a bias in estimation of camera parameters. Here's a picture of an 'old' charuco pattern taken with my iPhone: Which I can detect with:
but I am not so happy with the precision of corners, e.g. id=38 I have tried adding: Heres a charuco pattern generated in OpenCV-4.8 with above parameters.
Not sure how I initiate a community request. Is it a pull request on the repo you need? |
For now my problems were solved by calling the |
Related PR: #24479 |
@victor1234, thx, the module description and tutorial will be corrected. Can you attach the original image of the example? |
Partially fixed in 4.9.0. Moved to 4.10.0 milestone to finalize remaining issues. |
System Information
OpenCV python version: 4.7.0
Operating System / Platform: Debian GNU/Linux 11 (bullseye)
Python version: 3.9.2
Detailed description
It's my first time using charuco and I did not expect to encounter so many problems with this method.
According to the OpenCV docs, the idea of introducing Charuco was to make the classic chessboard pattern robust to partial view.
But when I ran the charuco corners detection, I realized that the detected chessboard corners did not match the real ones
According to the documentation and source code of
cv::CharucoDetector::detectBoard()
, this function doesn't detect chessboard corners. Instead, it detects inner ArUco markers and uses them to estimate the camera pose and project back the chessboard corners. It has two options: when you have camera intrinsic parameters and when you don't (it's our option). For the second option, it uses a homography matrix to estimate the chessboard corners, which means that this method does not account for distortion. Therefore, the reprojected positions of corners may be incorrect. After that, the method calls thecv::cornerSubPix()
method to refine the corners' positions, and if the initial reprojection position is not far away from the real one, this call could produce accurate detection. That's why not all corners are found incorrectly.Although this method is mentioned in many tutorials, it is not suitable for calibration.
Steps to reproduce
I got this problem running my own code, but for baseline I ran the official example
Issue submission checklist
The text was updated successfully, but these errors were encountered: