Complete the code to import the ArUco marker dictionary.
import cv2 aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.[1])
The DICT_4X4_50 dictionary is commonly used for ArUco markers with 4x4 bits and 50 unique markers.
Complete the code to detect ArUco markers in the image.
corners, ids, rejected = cv2.aruco.detectMarkers(image, [1])
The detectMarkers function requires the dictionary of markers to detect, which is aruco_dict.
Fix the error in the code to estimate the pose of the detected marker.
rvec, tvec, _ = cv2.aruco.estimatePoseSingleMarkers(corners, marker_length, [1], camera_matrix, dist_coeffs)
The third argument must be the camera matrix, which contains the camera's intrinsic parameters.
Fill both blanks to draw the detected marker's axis on the image.
cv2.aruco.drawAxis(image, [1], [2], rvec[0], tvec[0], axis_length)
The drawAxis function requires the camera matrix and distortion coefficients to correctly draw the axis.
Fill all three blanks to command the drone to land on the detected ArUco marker.
if ids is not None: x, y, z = tvec[0][0] drone.move_to(x[1]0.1, y[2]0.1, z[3]0.1) if abs(x) < 0.05 and abs(y) < 0.05 and abs(z) < 0.1: drone.land()
The drone should adjust its position by subtracting 0.1 to move closer to the marker coordinates.