Skip to content

Commit

Permalink
updates dependencies to more recent versions, improves initial projec…
Browse files Browse the repository at this point in the history
…t setup
  • Loading branch information
rladstaetter committed Apr 19, 2020
1 parent 2177f8f commit e540598
Show file tree
Hide file tree
Showing 31 changed files with 608 additions and 525 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.settings
.cache
target
.idea
.hydra/
.idea/

target/
*.iml
runs
8 changes: 0 additions & 8 deletions INSTALL.txt

This file was deleted.

41 changes: 0 additions & 41 deletions OpenCV-LICENSE.txt

This file was deleted.

28 changes: 23 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# SudokuFX

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

![a screenshot of the sudokuFX application](/screenshot.png "A screenshot from the project")

This is a project demonstrating what is necessary implement a Sudoku grabber and solver using the OpenCV Java API.
Just show your unsolved Sudoku puzzle to the camera, on the display the solution should appear.

This project only serves educational purposes and shows how to use the OpenCV Java API, for the UI it uses JavaFX.

This project comprises a JavaFX and an Android implementation, you can check out the [APK here](https://play.google.com/store/apps/details?id=net.ladstatt.apps.sudoku.android).
This project contains an android version as well, but it is unmaintained at the moment.

Maybe you want to read some blog posts about this project at http://ladstatt.blogspot.com/.
Target audience are Scala developers who want to play around with Image processing, it would need some polishing
to get a deployable and usable version.

# Building

SudokuFX uses maven as build tool. One dependency is opencv 3.1, which you will have to deploy yourself in your local repository.
See INSTALL.txt.
In order to get the project to run you have either install prebuild binaries of OpenCV or build it yourself. There
are some blog posts about this project on my [blog](http://ladstatt.blogspot.com/). I just recently (time of writing:
early 2020) updated dependencies to the latest versions, as such it should be 'no problem' to get it to run on your
machine.

You have to provide paths and version of OpenCV, either download a binary version from [their site])(https://opencv.org)
or build it from scratch. After successfully doing so, you have to invoke maven like this

mvn initialize -Pinstall-opencv -N

which installs the java wrapper to your local maven repository with the correct groupId/artifactId and version coordinates.

I've developed it on OsX, I tested it on Windows as well, at most it should run with small modifications.

Use at your own risk.

# License

Expand Down
1 change: 0 additions & 1 deletion lib/install.sh

This file was deleted.

Binary file removed lib/libopencv_java310.so
Binary file not shown.
Binary file removed lib/opencv-310.jar
Binary file not shown.
181 changes: 116 additions & 65 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,66 @@

<groupId>net.ladstatt.sudoku</groupId>
<artifactId>pom</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2020.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>nxs.ladstatt.sudoku.pom</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scala.version>2.11.8</scala.version>
<scala.major.version>2.12</scala.major.version>
<scala.full.version>${scala.major.version}.10</scala.full.version>
<opencv.major.version>4.3</opencv.major.version>
<opencv.full.version>${opencv.major.version}.0</opencv.full.version>
<opencv.install.path>/Users/lad/custom-builds/opencv-4.3.0/out/</opencv.install.path>
<opencv.java.jar>${opencv.install.path}share/java/opencv4/opencv-430.jar</opencv.java.jar>
</properties>

<modules>
<module>android-opencv</module>
<module>sudoku-core</module>
<module>sudoku-android</module>
<module>sudoku-javafx</module>
<!-- deactivated at the moment -->
<!--
<module>android-opencv</module>
<module>sudoku-android</module>
-->
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<version>${scala.full.version}</version>
</dependency>
<dependency>
<groupId>org.opencv</groupId>
<artifactId>opencv-java</artifactId>
<version>3.1.0</version>
<version>${opencv.full.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<groupId>net.ladstatt.sudoku</groupId>
<artifactId>sudoku-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck_2.11</artifactId>
<version>1.11.6</version>
<artifactId>scalacheck_${scala.major.version}</artifactId>
<version>1.13.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>2.2.2</version>
<artifactId>scalatest_${scala.major.version}</artifactId>
<version>3.0.4</version>
<scope>test</scope>
</dependency>
<!-- deactivated atm -->
<!--
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>5.0.1_r2</version>
<!-- <version>6.0_r2</version> -->
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -64,41 +72,23 @@
<version>9.2.0</version>
<type>aar</type>
</dependency>
<dependency>
<groupId>net.ladstatt.sudoku</groupId>
<artifactId>sudoku-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.ladstatt.sudoku</groupId>
<artifactId>android-opencv</artifactId>
<version>${project.version}</version>
<type>aar</type>
</dependency>
-->
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.4.2</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.2</version>
</dependency>
</dependencies>

</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<version>4.3.1</version>
<executions>
<execution>
<goals>
Expand All @@ -108,42 +98,103 @@
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<jvmArgs>
<jvmArg>-client</jvmArg>
<jvmArg>-Xms64m</jvmArg>
<jvmArg>-Xmx2G</jvmArg>
</jvmArgs>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>1.7</javacArg>
<javacArg>-target</javacArg>
<javacArg>1.7</javacArg>
</javacArgs>
<args>
<arg>-Xlint</arg>
<arg>-Ywarn-dead-code</arg>
<arg>-Ywarn-numeric-widen</arg>
<arg>-Ywarn-value-discard</arg>
<arg>-deprecation</arg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
<arg>-feature</arg>
<arg>-language:existentials</arg>
<arg>-language:higherKinds</arg>
<arg>-language:implicitConversions</arg>
<arg>-optimise</arg>
<arg>-target:jvm-1.6</arg>
<arg>-unchecked</arg>
</args>
<recompileMode>incremental</recompileMode>
<useZincServer>true</useZincServer>
<scalaVersion>${scala.major.version}</scalaVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<!-- <forkMode>once</forkMode> -->
<junitxml>.</junitxml>
<parallel>true</parallel>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.4.2</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.2</version>
</dependency>
</dependencies>
</plugin>
-->
</plugins>
</pluginManagement>
</build>

<profiles>
<!-- use this profile to install needed jar file in your local maven repository -->
<profile>
<id>install-opencv</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-opencv</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>initialize</phase>
<configuration>
<rules>
<requireFilesExist>
<message>Could not find ${opencv.java.jar}</message>
<files>
<file>${opencv.java.jar}</file>
</files>
</requireFilesExist>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>install-opencv-jar</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>initialize</phase>
<configuration>
<groupId>org.opencv</groupId>
<artifactId>opencv-java</artifactId>
<version>${opencv.full.version}</version>
<packaging>jar</packaging>
<file>${opencv.java.jar}</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

Expand Down
2 changes: 1 addition & 1 deletion sudoku-android/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sudoku Capturer (for Android)
# SudokuFX (for Android)

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion sudoku-android/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>

<string name="app_name">Sudoku Capturer</string>
<string name="app_name">SudokuFX</string>
<string name="button_rescan">neues Sudoku lösen</string>
<string name="use_in_landscape_mode">Handy quer halten bitte …</string>

Expand Down
2 changes: 1 addition & 1 deletion sudoku-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Sudoku Capturer</string>
<string name="app_name">SudokuFX</string>
<string name="button_rescan">rescan</string>
<string name="use_in_landscape_mode">Use in Landscape mode</string>
<string name="adunit_id">ca-app-pub-1727389366588084/4496274256</string>
Expand Down
Loading

0 comments on commit e540598

Please sign in to comment.