GithubHelp home page GithubHelp logo

nathanchrs / sudokuscanner Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 2.38 MB

Code for a LEGO EV3 robot that scans and solves sudoku puzzles using a webcam, then prints its answers

Home Page: https://www.youtube.com/watch?v=MUacBp8ZBeQ

License: MIT License

Python 100.00%
lego ev3 mindstorms python opencv ev3dev

sudokuscanner's Introduction

Sudoku Scanner

Program for an EV3 robot that reads a sudoku puzzle using a webcam and solves them.

By nathanchrs.

Modules

  • sudokuscanner.py: main program, run this program from EV3.
  • sudokusolver.py: sudoku puzzle checker and solver logic.
  • sudokucapture.py: reads a sudoku puzzle from an image.
  • opencv_functions.py: contains miscellaneous image processing functions from the OpenCV 2.4.12 Python 2 samples (common.py and digits.py).
  • digitcapture.py: reads free-standing digits from an image (currently the image must be clean and only contain the numbers).

Sample usage can be found by running each module directly.

Training Data

Training data for each dataset consists of 2 numpy .npy files:

  • samples.npy: contains a numpy float32 array of 20x20 px images.
  • labels.npy: contains a numpy array of integers corresponding to each image in the samples file.

These files are placed in the data/[DATASET_NAME]/ directory.

Currently there are 2 available datasets:

  • sudoku_digits: sans-serif 1-9 digits
  • handwritten_digits: handwritten 0-9 digits, generated from MNIST samples (see Credits).

There are trainer programs to help generate datasets:

  • train_sudoku_digits.py: uses data from sudoku images captured through a webcam, manually labelled by the user.
  • train_handwritten_digits.py: uses data from a training image (data/handwritten_digits/handwritten_digits.png).

Credits

This project uses the following open source components:

Handwritten digit training uses samples from MNIST: http://yann.lecun.com/exdb/mnist/

Sudoku digit samples uses sudoku puzzle images from Google Image Search.

References

sudokuscanner's People

Contributors

nathanchrs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.