Example #1
0
port = "COM4"  # 環境に合わせて変更して下さい
baud = 115200
circle_no = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
circle_point = []

path = 'circle_points.txt'
with open(path) as f:
    lines = f.read().split("\n")
    for line in lines:
        sp = line.split(",")
        circle_point.append([int(sp[0]), int(sp[1])])

dots = dict(zip(circle_no, circle_point))

Transform.capture_img_for_detect()


def bonus_num_detect():
    # 射影変換後の数字カード
    img = cv2.imread("./number.png", 0)

    # サイズ取得
    height = img.shape[0]
    width = img.shape[1]

    # 二値化
    ret, unknown = cv2.threshold(img, 0, 255, cv2.THRESH_OTSU)

    # 数字カードテンプレ読み込み
    numberList = []