项目作者: Haha89

项目描述 :
Sudoku puzzle solver in Python using OpenCV, Pytorch and Numpy
高级语言: Python
项目地址: git://github.com/Haha89/sudoku-solver.git
创建时间: 2020-08-25T14:52:35Z
项目社区:https://github.com/Haha89/sudoku-solver

开源协议:GNU General Public License v3.0

下载


sudoku-solver

Sudoku image solver program using Open CV, Pytorch and Numpy

How it works:

1) The picture given as input is resized, converted to grayscale and filtered using Opencv.
2) Main grid found using contour detection
3) Sudoku grid is transformed via perspective transformation
4) Each cell of the sudoku is extracted
5) OCR is done to get the digit of each cell
6) The reconstructed Sudoku is solved using backtracking

This project includes:

1) Training of a Convolutional Neural network for ORC using QMNIST dataset
2) A set of multiple sudoku puzzles for examples

Requirements:

  • Numpy
  • Matplotlib
  • OpenCV
  • Pytorch and Pytorchvision

Execution:

run python launcher.py [path] [debug]
path: optional, path of the picture containing the sudoku. If blank, uses the default picture displayed below
debug: optional, boolean to set to True if you want to see some plots

Result:

alt text
alt text

Next steps:

  • Increase OCR to better recognize the digits