From class ArucoDetector, detectMarkers() function doesnt work properly

Hello Everyone,
I use opencv-contrib 4.7.0.72 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).

HOWEVER,
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 ?
https://docs.opencv.org/4.x/d9/d6a/group__aruco.html#ga3bc50d61fe4db7bce8d26d56b5a6428a