Hello, fellow OpenCV users!
I recently realized a change in the behavior of the recent Aruco module in OpenCV and I am not sure if that’s a bug or something that was done on purpose (change of specification). I was unable to find any documentation or other bug reports about this, so I hope someone here is able to shed some light on this issue.
I generated a Charuco board of 5x7 squares from a DICT_6x6_250 dictionary, printed the board and took 10 images with my webcam. Now I used the standard procedure of detecting markers (detectMarkers, refineDetectedMarkers, interpolateCornersCharuco) and calibrating the camera (calibrateCameraCharuco). Finally I generated an image with Charuco corners and axes drawn on it using the calibration. With OpenCV version 4.2.0 I got the result on the left. Using the SAME program with OpenCV 4.6.0, I got the result on the right!
The numbering of the corner IDs has changed and that moved the coordinate system from one corner to the other and flipped the Z-axis!
This is not just a drawing issue. The estimated transformation between board and camera has changed, too.
The Charuco board generation has not changed, all generated Charuco boards of OpenCV 4.2.0, 4.6.0 and 4.7.0 are the same, so this is not the issue.
The change has also affected the single Aruco marker coordinate systems. In the current documentation under
https://docs.opencv.org/4.x/d5/dae/tutorial_aruco_detection.html
(scroll down to first image in “Pose Estimation”), the text still says “The marker coordinate system that is assumed by this function is placed in the center (by default) or in the top left corner of the marker with the Z axis pointing out, as in the following image.”, but the image shows Z-axes pointing in.
The issue is the same for OpenCV 4.7.0. The interface to the Aruco Library has changed. Adapting my program to OpenCV 4.7.0, the result is the same as for OpenCV 4.6.0 shown above.
I did not upload my code and the full set of data, since I don’t think the issue is with my code. But I can provide it on request.
Thanks in advance for some help.
Cheers, Philipp