def removeInnerGridLines(img):
template = cv2.imread('cross_template.jpg',0)
(tx,ty) = np.shape(template)
res = cv2.matchTemplate(img,template,cv2.TM_SQDIFF_NORMED)
threshold = 0.1
loc = np.where( res <= threshold)
for pt in zip(*loc[::-1]):
x = pt[0]
y = pt[1]
img,area,dummy = customFloodFill(img,(x + int(tx/2),y + int(ty/2)),0,0)
return img
# Reads in image of sudoku and does processing
评论列表
文章目录