Skip to content

Aruco related functions and objects do not work after an update from v4.5 to 4.11 #1084

@DigitalGabriele

Description

@DigitalGabriele

Hello,

I have the following lines of code that I used in opencv v4.5 that I rewrote to use opencv 4.11:

cv2.aruco_dict = cv2.aruco.Dictionary_get(aruco_dict_type)

changed to

aruco_dict = cv2.aruco.getPredefinedDictionary(aruco_dict_type)

parameters = cv2.aruco.DetectorParameters_create()

changed to

parameters = cv2.aruco.DetectorParameters()

aruco_board = cv2.aruco.Board_create(pos_board, cv2.aruco_dict, id_board)

changed to

aruco_board = cv2.aruco.Board(pos_board, aruco_dict, id_board)

corners, ids, rejected_img_points = cv2.aruco.detectMarkers(gray, cv2.aruco_dict,parameters=parameters, cameraMatrix=matrix_coefficients, distCoeff=distortion_coefficients)

changed to

aruco_detector = cv2.aruco.ArucoDetector(aruco_dict, parameters)
corners, ids, rejected_img_points = aruco_detector.detectMarkers(gray)

marker_detected, rvec_board, tvec_board = cv2.aruco.estimatePoseBoard(corners, ids, aruco_board, matrix_coefficients, distortion_coefficients, rvec_initial_guess, tvec_initial_guess)

I have no idea what to do with this one.

cv2.aruco.drawDetectedMarkers(frame, corners)
Not changed.

cv2.aruco.drawAxis(frame, matrix_coefficients, distortion_coefficients, rvec_board, tvec_board, length=0.25)
Not changed.

I would appreciate your guidance on two things:

  1. If my key changes are correct.
  2. How to change the cv2.aruco.estimatePoseBoard() to the new version? Is there an equivalent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions