diff --git a/exp/board_detect.py b/exp/board_detect.py --- a/exp/board_detect.py +++ b/exp/board_detect.py @@ -246,6 +246,7 @@ class BoardDetector: return sum(self._hough.scoreLine(p.transform(self._inverseMatrix)) for p in itertools.chain(*lines)) def detectPosition(self,img): + if not self.grid: return None (rows,cols)=self.grid intersections=[[row.intersect(col) for col in cols] for row in rows] position=[[self._detectStoneAt(img,point) for point in row] for row in intersections]