Skip to content

Instantly share code, notes, and snippets.

@Merwanski
Last active November 13, 2022 09:53
Show Gist options
  • Save Merwanski/5efe804ec43ba16340889a00ab5250dd to your computer and use it in GitHub Desktop.
Save Merwanski/5efe804ec43ba16340889a00ab5250dd to your computer and use it in GitHub Desktop.
aruco marker generator
import cv2
import cv2.aruco as aruco
# Select type of aruco marker (size)
aruco_dict = aruco.Dictionary_get(aruco.DICT_5X5_1000)
# Create an image from the marker
# second param is the ID number
# last param is the image size
img = aruco.drawMarker(aruco_dict, 2, 700)
cv2.imwrite("test_marker.jpg", img)
# Display the image
cv2.imshow('frame', img)
# Exit
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment