How it works...
As has been mentioned, AruCo markers have special designs and encode an identifier in black and white squares inside. So, to create the proper marker, it's necessary to follow the rules, and to also set parameters, such as the marker size and identifier. All of this can be done with the cv2.aruco.drawMarker function. It accepts a dictionary of the markers, an identifier of the marker, and image size. The dictionary determines the correspondence between the marker's appearance and the marker's ID, and returns the image with a drawn marker. OpenCV includes predefined dictionaries, which can be retrieved with the cv2.aruco.getPredefinedDictionary function (which takes the dictionary name as an argument). In the preceding code, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access