Commit 1ddd7ae4 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Rename parse.py -> detection.py

parent 3683dbca
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import os import os
import numpy as np import numpy as np
from PIL import Image from PIL import Image
from parse import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, MIN_COLUMN_SAT, \ from detection import BLOCK_SIZE, COLUMN_VSHIFT, MIN_COLUMN_VAL, \
detect_blocks, detect_exa, detect_held, print_board, \ MIN_COLUMN_SAT, detect_columns
detect_columns
from strategy import State from strategy import State
...@@ -37,10 +36,8 @@ if __name__ == '__main__': ...@@ -37,10 +36,8 @@ if __name__ == '__main__':
board = Image.open('screens/board%d.png' % ident).convert('HSV') board = Image.open('screens/board%d.png' % ident).convert('HSV')
#board.crop((0, 0, board.width, detect_columns(board))).show() #board.crop((0, 0, board.width, detect_columns(board))).show()
blocks = list(detect_blocks(board)) state = State.detect(board)
exa = detect_exa(board) state.print()
held = detect_held(board, exa)
print_board(blocks, exa, held)
if extensive: if extensive:
make_bitmap(board).save('screens/bitmap%d.png' % ident) make_bitmap(board).save('screens/bitmap%d.png' % ident)
......
...@@ -2,8 +2,9 @@ import io ...@@ -2,8 +2,9 @@ import io
import time import time
from contextlib import redirect_stdout from contextlib import redirect_stdout
from itertools import combinations, islice from itertools import combinations, islice
from parse import COLUMNS, NOBLOCK, detect_blocks, detect_exa, \ from detection import COLUMNS, NOBLOCK, detect_blocks, detect_exa, \
detect_held, print_board, is_basic, is_bomb, bomb_to_basic detect_held, print_board, is_basic, is_bomb, \
bomb_to_basic
GRAB, DROP, SWAP, LEFT, RIGHT, SPEED = range(6) GRAB, DROP, SWAP, LEFT, RIGHT, SPEED = range(6)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment