{"by":"taiters_","descendants":16,"id":41299594,"kids":[41299788,41301109,41300125,41310049,41299976,41299950,41309588],"score":63,"text":"Hello!<p>I recently wanted to learn a bit about computer vision. Initially, I wanted to build something which could solve a jigsaw puzzle, but figured I should start with something (much) simpler, so I&#x27;ve built this instead.<p>This is a visual Sudoku solver which runs in the browser. It works by using OpenCV to identify and process the Sudoku grid, passing this to a simple ML model to identify the digits, and then solving the puzzle with a backtracking algorithm. The ML model was trained on the TMNIST data set using a model built with Keras, also a completely new area to me.<p>It&#x27;s far from perfect, and doesn&#x27;t like non perfectly lit or overly warped puzzles, but the main goal here was learning, which I did, a lot.<p>As this was primarily a learning project, I&#x27;ve tried to document my approach as much as possible, which can be found in this Python notebook:<p><a href=\"https:&#x2F;&#x2F;github.com&#x2F;Taiters&#x2F;sudoku-solver&#x2F;blob&#x2F;main&#x2F;notebooks&#x2F;explore.ipynb\">https:&#x2F;&#x2F;github.com&#x2F;Taiters&#x2F;sudoku-solver&#x2F;blob&#x2F;main&#x2F;notebooks...</a><p>I used Python while exploring OpenCV and training the models etc, and eventually ported this over to web (OpenCV.js + Tensorflow.js) to get something I could actually share with people.<p>Feel free to have a dig around the source or play around with the solver!<p>Github: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Taiters&#x2F;sudoku-solver\">https:&#x2F;&#x2F;github.com&#x2F;Taiters&#x2F;sudoku-solver</a>","time":1724158155,"title":"Show HN: Visual Sudoku solver in the browser","type":"story","url":"https://sudoku.dotslashdan.com/"}