Coder Social home page Coder Social logo

rladstaetter / sudokufx Goto Github PK

View Code? Open in Web Editor NEW
68.0 12.0 24.0 62.39 MB

AR Sudoku grabber and solver using JavaCV, JavaFX and Scala

License: Apache License 2.0

Scala 11.76% Java 88.24%
javafx opencv sudoku scala javacv augmented-reality sudoku-grabber jdk11 solver

sudokufx's Introduction

SudokuFX

A project which uses JavaCV (OpenCV) to solve Sudoku puzzles with a live display of the computed solution.

Just show your unsolved Sudoku puzzle to the camera, on the display a solution should appear in a short timeframe. If a Sudoku was not recognized properly the videostream flickers for an instant.

This project only serves educational purposes and shows how to use JavaCV and - under the hood- OpenCV features and JavaFX GUI programming.

Target audience are Scala/Java developers who want to play around with image processing.

Building

One feature of this project is that it should run out of the box with minimal setup. Given you have installed Jdk11 and Maven in a recent version, all you have to do to build it would be to execute

mvn package

in the root directory.

For executing SudokuFX on the command line, change to the sudoku-javafx subdirectory and enter

mvn javafx:run

Documentation

This project is mainly un - documented, but some blog posts exist, check them out at http://ladstatt.blogspot.com/.

SudokuFX was developed on OsX and was tested on Windows, but there should be no reason why it wouldn't run on Linux.

Attention: This project contains also an android (legacy) version, but it is unmaintained at the moment and won't compile.

License

Apache License 2.0

sudokufx's People

Contributors

abhinayagarwal avatar dependabot[bot] avatar rladstaetter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sudokufx's Issues

Fails with NullPointerException then hangs

On my Windows system, sudoku2go in most caes gets stuck with an empty window, but sometimes it displays a captured picture but says it could not recognize digits. The following is printed to stderr:

Exception in runnable
java.lang.NullPointerException
    at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:111)
    at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:111)
    at scala.collection.SeqLike$class.size(SeqLike.scala:102)
    at scala.collection.mutable.ArrayOps$ofRef.size(ArrayOps.scala:105)
    at scala.collection.mutable.Builder$class.sizeHint(Builder.scala:69)
    at scala.collection.mutable.ArrayBuilder.sizeHint(ArrayBuilder.scala:24)
    at scala.collection.TraversableLike$class.builder$1(TraversableLike.scala:240)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:243)
    at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:105)
    at net.ladstatt.apps.Sudokuaner$$anonfun$loadLibImages$1.apply(Sudoku2go.scala:518)
    at net.ladstatt.apps.Sudokuaner$$anonfun$loadLibImages$1.apply(Sudoku2go.scala:515)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.immutable.Range.foreach(Range.scala:142)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at net.ladstatt.apps.Sudokuaner$class.loadLibImages(Sudoku2go.scala:515)
    at net.ladstatt.apps.Sudoku2go.loadLibImages(Sudoku2go.scala:722)
    at net.ladstatt.apps.Sudokuaner$class.mkTemplateLibrary(Sudoku2go.scala:541)
    at net.ladstatt.apps.Sudoku2go.mkTemplateLibrary(Sudoku2go.scala:722)
    at net.ladstatt.apps.Sudoku2go.templateLibrary$lzycompute$1(Sudoku2go.scala:877)
    at net.ladstatt.apps.Sudoku2go.net$ladstatt$apps$Sudoku2go$$templateLibrary$1(Sudoku2go.scala:877)
    at net.ladstatt.apps.Sudoku2go$$anonfun$24.apply(Sudoku2go.scala:884)
    at net.ladstatt.apps.Sudoku2go$$anonfun$24.apply(Sudoku2go.scala:884)
    at net.ladstatt.apps.Sudokuaner$$anonfun$13$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$13$$anonfun$apply$14.apply(Sudoku2go.scala:696)
    at net.ladstatt.apps.Sudokuaner$$anonfun$13$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$13$$anonfun$apply$14.apply(Sudoku2go.scala:682)
    at net.ladstatt.apps.Utils$class.option(Sudoku2go.scala:91)
    at net.ladstatt.apps.Sudoku2go.option(Sudoku2go.scala:722)
    at net.ladstatt.apps.Sudokuaner$$anonfun$13$$anonfun$apply$10$$anonfun$apply$11.apply(Sudoku2go.scala:681)
    at net.ladstatt.apps.Sudokuaner$$anonfun$13$$anonfun$apply$10$$anonfun$apply$11.apply(Sudoku2go.scala:668)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1417)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
^C

Then it hangs after I close its window so I have to kill it.

This is on a Windows 8 laptop with 32-bit JDK 7u25, OpenCV version is 2.4.6.

OpenCV Error: Assertion failed

HI, i have just pulled code from rladstaetter/net.ladstatt.
When I run sudoku2go it shows blank window with Sudoku2go caption and there is error in console.log:

camera initialisation: 203 ms
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /Users/scriper/Downloads/opencv-2.4.6.1/modules/imgproc/src/color.cpp, line 3402
Exception in thread "JavaFX Application Thread" CvException [org.opencv.core.CvException: /Users/scriper/Downloads/opencv-2.4.6.1/modules/imgproc/src/color.cpp:3402: error: (-215) scn == 3 || scn == 4 in function cvtColor
]
    at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:4368)
    at net.ladstatt.jfx.OpenCVUtils$class.colorSpace(OpenCVUtils.scala:327)

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.