Commit ed7e949a authored by Taddeüs Kroes's avatar Taddeüs Kroes

Check one additional pixel for basic blocks to avoid false positive in board 23

parent 1959f5d4
...@@ -20,6 +20,7 @@ BOMB_HUES = [250, 219, 132, 174, 38] ...@@ -20,6 +20,7 @@ BOMB_HUES = [250, 219, 132, 174, 38]
HUE_TOLERANCE = 5 HUE_TOLERANCE = 5
DETECT_BASIC_X = 9 DETECT_BASIC_X = 9
DETECT_BASIC_Y = 15 DETECT_BASIC_Y = 15
DETECT_BASIC_Y_CHECK = 17
DETECT_BOMB_X = 22 DETECT_BOMB_X = 22
DETECT_BOMB_Y = 43 DETECT_BOMB_Y = 43
DETECT_BOMB_Y_TOLERANCE = 7 DETECT_BOMB_Y_TOLERANCE = 7
...@@ -77,6 +78,9 @@ def detect_block(board, x, y): ...@@ -77,6 +78,9 @@ def detect_block(board, x, y):
y + DETECT_BASIC_Y)) y + DETECT_BASIC_Y))
if s >= MIN_BASIC_SAT: if s >= MIN_BASIC_SAT:
for ty, hexpect in enumerate(BASIC_HUES): for ty, hexpect in enumerate(BASIC_HUES):
if is_hue(h, hexpect):
h, s, v = board.getpixel((x + DETECT_BASIC_X,
y + DETECT_BASIC_Y_CHECK))
if is_hue(h, hexpect): if is_hue(h, hexpect):
return ty return ty
......
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