Skip to content

ChArUco pattern has broken backward compatibility #23152

@stefan523

Description

@stefan523

System Information

OpenCV version: 4.7.0

Detailed description

ChArUco patterns have been moved recently from OpenCV contrib to the main branch in OpenCV 4.7.0, but such patterns have been used for a longer time across the world. Backwards compatiblity with pre-existing targets and data needs to be ensured to avoid waste of resources and material.

OpenCV (contrib) 4.6.0 introduced a backwards incompatible change in ChArUco pattern generation for even row count. The impact is quite big.

  • Existing calibration targets that have been self-manufactured or procured expensively are incompatible with the latest OpenCV versions.
  • On stock targets from e.g. https://calib.io/ do not work with OpenCV anymore.
  • Acquired calibration data images cannot be processed anymore.

Related issues in OpenCV contrib:

A fix is available that enables support for pre and post 4.6.0 patterns.

Steps to reproduce

import cv2
aruco_dict = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_5X5_1000)
charuco_board = cv2.aruco.CharucoBoard_create(
    squaresX = 5,
    squaresY = 4,
    squareLength = 4,
    markerLength = 3,
    dictionary = aruco_dict
)
img_board = charuco_board.draw((250,200), marginSize=0, borderBits=1)
cv2.imwrite('charuco_OpenCV-' + cv2.__version__ + '.png', img_board)

OpenCV 4.5.5:
OpenCV 4 5 5

OpenCV 4.6.0:
OpenCV 4 6 0

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions