diff --git a/TCCPrinting.py b/TCCPrinting.py index 919c767..e46c881 100644 --- a/TCCPrinting.py +++ b/TCCPrinting.py @@ -47,18 +47,20 @@ # ここからTIASカラーチャート用画像の生成 full_image = np.full((1545, 810, 3), dtype=np.uint8, fill_value=[255, 255, 255]) - full_image[210 : 210 + image_h, 30 : 30 + image_w, :] = rgb_image + ssize = (600, 888) + rgb_image_s = cv2.resize(rgb_image, ssize) + full_image[274 : 274 + ssize[1], 105 : 105 + ssize[0], :] = rgb_image_s aruco = cv2.aruco dictionary = aruco.getPredefinedDictionary(aruco.DICT_4X4_50) for i in range(2): marker_id = 40 + i - marker = aruco.generateImageMarker(dictionary, marker_id, 150) - x = 330 + (i // 2) * 200 - y = 30 + (i % 2) * 1335 - full_image[y : y + 150, x : x + 150, 0] = marker - full_image[y : y + 150, x : x + 150, 1] = marker - full_image[y : y + 150, x : x + 150, 2] = marker + marker = aruco.generateImageMarker(dictionary, marker_id, 120) + x = 345 + (i // 2) * 200 + y = 130 + (i % 2) * 1070 + full_image[y : y + 120, x : x + 120, 0] = marker + full_image[y : y + 120, x : x + 120, 1] = marker + full_image[y : y + 120, x : x + 120, 2] = marker x = 50 + (i // 2) * 700 y = 60 + (i % 2) * 1420 cv2.putText( @@ -92,10 +94,30 @@ date_str = datetime.datetime.now().strftime("%Y.%m.%d") cv2.putText( full_image, - f"Tongue Color Checker, Chiba University {date_str}", - (45, 1345), + "Tongue Color Checker", + (210, 1380), cv2.FONT_HERSHEY_TRIPLEX, - 0.8, + 1.0, + (0, 0, 0), + 1, + cv2.LINE_AA, + ) + cv2.putText( + full_image, + "Chiba University", + (250, 1420), + cv2.FONT_HERSHEY_TRIPLEX, + 1.0, + (0, 0, 0), + 1, + cv2.LINE_AA, + ) + cv2.putText( + full_image, + date_str, + (300, 1460), + cv2.FONT_HERSHEY_TRIPLEX, + 1.0, (0, 0, 0), 1, cv2.LINE_AA,