diff --git a/ar_tag_pose_aruco_board.py b/ar_tag_pose_aruco_board.py index 375422f..1fec8aa 100644 --- a/ar_tag_pose_aruco_board.py +++ b/ar_tag_pose_aruco_board.py @@ -1,6 +1,7 @@ from PIL.ImageOps import posterize from ar_tag_pose import ArTagPose +from aruco_types import ARUCO_DICT import numpy as np import cv2 as cv @@ -12,7 +13,8 @@ def factory(dict_type: int, board_size: cv.typing.Size, marker_length: float=100 im_w = int(board_size[0] * (marker_length + marker_sep) - marker_sep + 2 * margins) im_h = int(board_size[1] * (marker_length + marker_sep) - marker_sep + 2 * margins) image = board.generateImage((im_w, im_h), None, margins, 1) - cv.imwrite("results/aruco_board.png", image) + keyname = [key for key, val in ARUCO_DICT.items() if val == dict_type][0] + cv.imwrite(f"results/aruco_board_w{board_size[0]}_h{board_size[1]}_{keyname}.png", image) return detector, board