Open heidydallard opened 2 years ago
I've experienced a similar issue. There's been a breaking change that causes charuco board to be drawn differently in opencv 4.6.0 and consequently the object points are all wrong when you analyze a board that was generated using pre-4.6.0 code (off by one square). This is the result of the call to the following code in 4.6.0:
dictionary = cv2.aruco.getPredefinedDictionary(7)
sz_wh = (29, 18)
charucoboard = cv2.aruco.CharucoBoard_create(sz_wh[0], sz_wh[1], 0.01, 0.007, dictionary)
img_board = charucoboard.draw((sz_wh[0]*40,sz_wh[1]*40), marginSize=100)
plt.imshow(img_board, cmap='gray')
It differs from your printed board in that the first square (top left corner) is black and not white with marker.
This is the same code in 4.5.5 (identical to your physical board):
I think I traced the breaking change to this commit by @AleksandrPanov, please take a look
@heidydallard, @gmedan in the new version of OpenCV, Charuco boards are created in the same way as chess boards. Patterns with an even number of rows are now different (https://github.com/opencv/opencv_contrib/issues/3291).
PR https://github.com/opencv/opencv_contrib/pull/3305 added legacy
flag to support older pattern versions. This PR fixed this problem.
Thank you @AleksandrPanov for your support.
System information (version)
Detailed description
With the version 4.6.0, the function interpolateCornersCharuco misplace some corners. In my case, the corners that are misplaced are the right most ones that are placed at the center of the board. The previous steps of the detection with the drawDetectedMarkers is working correctly. I have tested with the version 4.5.5 and it works in this version.![result](https://user-images.githubusercontent.com/5871554/177934920-2ebb4f64-1f29-49ab-8a99-033dea96975a.png)
Steps to reproduce
Here is the image used to do the test.![image](https://user-images.githubusercontent.com/5871554/177936113-1ef6989e-c657-4ae9-8003-02dca2d0964b.png)
Issue submission checklist