Created
April 4, 2019 23:13
-
-
Save michtesar/f4c23d5b4606d19bc3a4acbfb8d54b4d to your computer and use it in GitHub Desktop.
Generate Aruco markers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import cv2, PIL | |
| from cv2 import aruco | |
| import matplotlib.pyplot as plt | |
| import matplotlib as mpl | |
| import pandas as pd | |
| aruco_dict = aruco.Dictionary_get(aruco.DICT_ARUCO_ORIGINAL) | |
| fig = plt.figure() | |
| nx = 4 | |
| ny = 3 | |
| for i in range(1, nx*ny+1): | |
| ax = fig.add_subplot(ny,nx, i) | |
| img = aruco.drawMarker(aruco_dict,i, 700) | |
| plt.imshow(img, cmap = mpl.cm.gray, interpolation = "nearest") | |
| ax.axis("off") | |
| plt.savefig("markers.pdf") | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment