Giter VIP home page Giter VIP logo

ar-sudoku-solver's Introduction

AR-Sudoku-Solver

A augmented reality sudoku solver using random forest classifier and backtracking algorithm

Link to demo -> demo

Description

1.Building the dataset

For building the dataset the same program is used which is used for capturing the square grids during solving.

Installation

pip install opencv-python

By this method we are capturing 23 by 23 size grayscale images. There are 529 features, upon which the classifier will be trained.

Sample training images -

Total 1600 images of numbers from 0-9 are then fed to the dataset generator program which generates the required .csv file. The generated file with 530 coloumns is then used by model builder , which makes a random forest classifier. Accurracy acheived on test data is around 98%.

What is Random Forest Classification?

A Random Forest Classifier is a set of decision trees which randomly select subset of training set. The final decision comes from the aggregation of votes from all the trees. It has been implemented with the scikit-learn library.

Note-

(optional) For shuffling up the csv file we can do this after reading the file-

data = data.sample(frac = 1).reset_index(drop = True)

Grabbing the digits from the grid

Countours are been used to detect polygons present in the live video. They later are been filtered out on the basis of countour-area and no. of sides.

The extracted digits are then predicted using our pre-trained ML model , and the whole numbers are sent to the sudoku solver which solves it with efficient backtracking algorithm.

Solving

Backtracking algorithm - Backtracking is an algorithmic-technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time.

One of the fastest solves in 16 msecs!

Sudoku Solving Vizualizer

Resources

For getting the sudoku puzzles go to - http://www.websudoku.com/

For getting solution of puzzles go to - https://sudokusolver.net/

ar-sudoku-solver's People

Contributors

yashindane 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.