ros-perception / image_pipeline

An image processing pipeline for ROS.
Other
762 stars 715 forks source link

fix: cv2.aruco.interpolateCornersCharuco is deprecated #979

Closed tfoldi closed 1 month ago

tfoldi commented 1 month ago

There has been API Changes in the newer releases of opencv2 (from 4.8.0). The PR addresses this by supporting both the old and new APIs.

updated Syntax

charucodetector = cv2.aruco.CharucoDetector(board)
charuco_corners, charuco_ids, marker_corners, marker_ids = charucodetector.detectBoard(image)

before 4.8.0

marker_corners, marker_ids, rejectedImgPoints = cv2.aruco.detectMarkers( image, dictionary)
retval, charuco_corners, charuco_ids = cv2.aruco.interpolateCornersCharuco( marker_corners, marker_ids, image, board)

See the changed examples in the main opencv2 repo:

https://github.com/opencv/opencv/blob/f9a59f2592993d3dcc080e495f4f5e02dd8ec7ef/samples/python/calibrate.py#L110

ahcorde commented 1 month ago

https://github.com/Mergifyio backport jazzy

mergify[bot] commented 1 month ago

backport jazzy

✅ Backports have been created

* [#980 fix: cv2.aruco.interpolateCornersCharuco is deprecated (backport #979)](https://github.com/ros-perception/image_pipeline/pull/980) has been created for branch `jazzy`