diff --git a/exp/board_detect.py b/exp/board_detect.py --- a/exp/board_detect.py +++ b/exp/board_detect.py @@ -56,9 +56,9 @@ def filterStones(contours,bwImg,stoneDim coverage1=area/(w*h or 1) hull=cv.convexHull(c) coverage2=area/(cv.contourArea(hull) or 1) - if coverage2<0.8: - cv.drawMarker(contourImg,tuple(map(int,center)),(0,127,255),cv.MARKER_DIAMOND,12) - keep=False + # if coverage2<0.8: + # cv.drawMarker(contourImg,tuple(map(int,center)),(0,127,255),cv.MARKER_DIAMOND,12) + # keep=False if keep: res.append((EPoint(*center),c)) cv.drawMarker(contourImg,tuple(map(int,center)),(255,0,0),cv.MARKER_CROSS) @@ -117,14 +117,12 @@ class BoardDetector: # detect lines from edges and stones edgeImg=prepareEdgeImg(rect) hough=HoughTransform(edgeImg) - hough.extract() stonesImg=np.zeros((self._rectH,self._rectW),np.uint8) for (point,c) in stones: cv.circle(stonesImg,(int(point.x),int(point.y)),2,255,-1) # cv.drawContours(stonesImg,[c for (point,c) in stones],-1,255,-1) show(stonesImg,"detected stones") - # hough.update(stonesImg,5) - hough=HoughTransform(stonesImg) + hough.update(stonesImg,5) hough.extract() # # detect lines passing through the stones