From class ArucoDetector, detectMarkers() function doesnt work properly

Hello Everyone,
I use opencv-contrib and I’m trying to use the detectMarkers() function from the ArucoDetector class, which takes only an Image as input. But I keep getting the following error. I appreciate your help.

descriptor ‘detectMarkers’ for ‘cv2.aruco.ArucoDetector’ objects doesn’t apply to a ‘numpy.ndarray’ object

please show, how you invoke it (code !)

grey = cv2.imread(“path_to_file”)
rgb= cv2.cvtColor(grey.copy(), cv2.COLOR_GRAY2BGR)
pts2d, ids,ret = cv2.aruco.ArucoDetector.detectMarkers(rgb).

In another file, I have a class which inherits from aruco.ArucoDetector(), when I call super().detectMarkers(rgb) it works!!

that’s wrong.
you first need to create a cv2.aruco.ArucoDetector instance (this is a class !!) ,
then call detectMarkers() on that.
(it’s not a static/free function !)

maybe you confused it with this ?