GithubHelp home page GithubHelp logo

clever-cell's Introduction

CleverCell

CleverCell, a Sudoku solver, takes input as an image, solves the puzzle, and displays the result directly on the original puzzle interface.


Technologies Used

  • Programming Language : Python
  • Machine Learning : Tensorflow and Keras (For digit recognition)
  • Libraries : Numpy (for array processing) and OpenCV (for image processing)

Basic setup


Clone the project

  git clone https://github.com/Vishvam10/AI-Sudoku-Solver.git

Go to the project directory

  cd my-project

Create a virtual environment in the project folder

  python3 -m venv /path/to/new/virtual/environment

Activate the virtual environment

  .\venv\Scripts\activate

NOTE : Please visit this link to know more about installing virtual environments


Install the dependencies using pip

  pip install - r requirements.txt

Run the program with default options. Add the -d to run the program in debug mode and -i to specify the image path

  python app.py -i "./Testing_Images/pass_1.jpg" -d

Features

  • Solves sudoku of any difficulty
  • ✅ Works on any type of image (.png, .jpg, etc.)
  • ✅ Automatic rescaling and resizing
  • ✅ Errors for unsolvable problems

Future Improvements

  • One main thing would be to make it real time. The code for it is pretty straight-forward. All we need to do is pass the captured frame as the image input. Something like this :

    cap = cv2.VideoCapture(0)
    fourcc = cv2.VideoWriter_fourcc(*'XVID')
    flag = 0
    
    while(True) :
        ret, img = cap.read()
        .
        .
    
    

    While doing so, we need to proceed with the ML model only when the sudoku board is identified. And for that, a hard-coded value of image dimensions would not work. I've experimented with realtime but the results were not satisfactory (either the digits were recognized incorrectly or the board was not getting identified). There are ways to mitigate these issues and optimize the whole program. These could be implemented in the near future.

  • Improving the ML model : Currently, there are a few cases where 1 or digits are misclassified, which is generally accepted to be normal. But in the case of a sudoku, even 1 misclassification can alter the problem. For example, the image located ./Testing_Images/fail_1.png fails due to this exact problem :

    Misclassification Problem

clever-cell's People

Contributors

vishvam10 avatar

Stargazers

Roman avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

huiswan

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.