diff --git a/src/imageanalyzer.py b/src/analyzer/__init__.py copy from src/imageanalyzer.py copy to src/analyzer/__init__.py --- a/src/imageanalyzer.py +++ b/src/analyzer/__init__.py @@ -1,13 +1,12 @@ import logging as log -from grid import Grid -from go import exportBoard -import go +from .grid import Grid +from go.core import exportBoard, EMPTY,BLACK,WHITE class ImageAnalyzer: def __init__(self,tresB=30,tresW=60): - self.board=[[go.EMPTY]*19 for r in range(19)] + self.board=[[EMPTY] * 19 for r in range(19)] self.grid=None self.tresB=tresB @@ -48,9 +47,9 @@ class ImageAnalyzer: log.debug("(%d,%d) ... (b=%d,w=%d,e=%d)", row, col, b, w, e) - if b>=w and b>=e: return go.BLACK - if w>=b and w>=e: return go.WHITE - return go.EMPTY + if b>=w and b>=e: return BLACK + if w>=b and w>=e: return WHITE + return EMPTY def setGridCorners(self,corners): self.grid=Grid(corners)