|
|
@@ -2,9 +2,9 @@
|
|
|
import os
|
|
|
import numpy as np
|
|
|
from PIL import Image
|
|
|
-from parser import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, MIN_COLUMN_SAT, \
|
|
|
- detect_blocks, detect_exa, detect_held, print_board, \
|
|
|
- detect_columns
|
|
|
+from parse import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, MIN_COLUMN_SAT, \
|
|
|
+ detect_blocks, detect_exa, detect_held, print_board, \
|
|
|
+ detect_columns
|
|
|
from strategy import State
|
|
|
|
|
|
|
|
|
@@ -33,11 +33,10 @@ def make_bitmap(board):
|
|
|
if __name__ == '__main__':
|
|
|
import sys
|
|
|
ident = int(sys.argv[1])
|
|
|
- extensive = sys.argv[2] == 'y' if len(sys.argv) > 2 else False
|
|
|
+ extensive = len(sys.argv) > 2 and sys.argv[2] == 'y'
|
|
|
|
|
|
board = Image.open('screens/board%d.png' % ident).convert('HSV')
|
|
|
#board.crop((0, 0, board.width, detect_columns(board))).show()
|
|
|
- state = State.detect(board)
|
|
|
blocks = list(detect_blocks(board))
|
|
|
exa = detect_exa(board)
|
|
|
held = detect_held(board, exa)
|