Giter Club home page Giter Club logo

sudoku-solver's Introduction

Solve SUDOKU from Image

A project to solve a Sudoku from a given image.

Input

Image file with unsolved Sudoku

Output

The same image file with filled in solution

Current State

Images currently can not be rotated so only images with perfect rotation are processed. Only images with only one Sudoku and no other artifacts can be processed. The Sudoku does not have to be fullscreen as a single Sudoku can be detected and cropped. Each detected Sudoku is scaled to 500x500 pixels and stored like this.

Contents

sudoku_solver.py

Provides functions to solve a sudoku puzzle.

Sudokus are formatted as a string where the rows are concatenated and empty spaces are represented as "0" or as ".".

"100200040020003900907000500004000057000541000350000100003000709001400080090002006"

solve_sudoku_from_image.py

Takes an image of a unresolved Sudoku puzzle as input, detects the existing digits, solves the Sudoku and returns the given image with the solution filled in. The output file is stored to the same directory as the input and has "_solved" concatenated to the image name.

python3 solve_sudoku_from_image.py --image <path>

OpenCV2 is used for the image processing.

Tesseract is used to detect the digits in the given image.

sudoku-solver's People

Contributors

kleinsamuel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.