converting puzzle game from ocr to template matching