- Import the modules:
import cv2import cv2.aruco as arucoimport numpy as np
- Create an image with different AruCo markers, blur it, and then display it:
aruco_dict = aruco.getPredefinedDictionary(aruco.DICT_6X6_250)img = np.full((700, 700), 255, np.uint8)img[100:300, 100:300] = aruco.drawMarker(aruco_dict, 2, 200)img[100:300, 400:600] = aruco.drawMarker(aruco_dict, 76, 200)img[400:600, 100:300] = aruco.drawMarker(aruco_dict, 42, 200)img[400:600, 400:600] = aruco.drawMarker(aruco_dict, 123, 200)img = cv2.GaussianBlur(img, (11, 11), 0)cv2.imshow('Created AruCo markers', img)cv2.waitKey(0)cv2.destroyAllWindows()
- Detect the markers on the blurred image. Draw the detected markers and display the results:
aruco_dict = aruco.getPredefinedDictionary(aruco.DICT_6X6_250) ...