opencv / opencv-python

Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.
https://pypi.org/project/opencv-python/
MIT License
4.58k stars 858 forks source link

Charuco Behavior in opencv-python-contrib #686

Closed kopecn closed 2 years ago

kopecn commented 2 years ago

our unit tests for charuco handling have started breaking in 4.6.0.66 and was uniformly passing in 4.5.5.64 and earlier.

Has there been any major changes that could impact --> cv2.aruco.detectMarkers going from 4.5 to 4.6?

Let me know what sample code is needed to help out.

asmorkalov commented 2 years ago

There were a lot of fixes in Aruco and related code: https://github.com/opencv/opencv_contrib/pulls?q=is%3Apr+is%3Aclosed+label%3A%22category%3A+aruco%22

kopecn commented 2 years ago

I was able to dig a bit more, and see that the cv2.aruco.CharucoBoard_create does different layout for charuco, and wanted to ask if this was the expected behavior. Perhaps fixing something that was previously wrong?

board = cv2.aruco.CharucoBoard_create( 10, 10, 0.0337, 0.02696, 5, )

image
AleksandrPanov commented 2 years ago

@kopecn there is behavior change only with even row count. There were several bugs: https://github.com/opencv/opencv_contrib/issues/2623, https://github.com/opencv/opencv_contrib/issues/2604

This path fixed this and now CharucoBoard behavior is aligned with chessboard: https://github.com/opencv/opencv/blob/4.x/doc/pattern.png

You can use the suggested patch in #3291 issue. But it is recommended to use new patterns, as the calibration might not work correctly on old patterns.

kopecn commented 2 years ago

Excellent! Thank you for the help/feedback! We will make the adjustments as you recommend and update our old patterns.