sami-badawi / shapelogic-scala

Generic computer vision in Scala
http://shapelogicscala.org/
MIT License
13 stars 3 forks source link
computer-vision functional-programming generic image-processing javafx scala

Logo

ShapeLogic Scala

ShapeLogic Scala is a generic computer vision library with cross-platform GUI. You write your image processing algorithm once, and it will work for images based on byte, short, float and double.

It has standard image processing algorithms like: Invert, threshold, edge detection, segmentation, skeletonize, edge tracer, vectorizer, point and line annotation all written in generic idiomatic Scala.

Getting Started

Include ShapeLogic as library in your SBT project

"org.shapelogicscala" %% "shapelogic" % "0.9.0"

Versions available for Scala 2.11 and 2.12

Work with ShapeLogic source locally

clone git https://github.com/sami-badawi/shapelogic-scala.git
cd shapelogic-scala
sbt compile
sbt test

Start the ShapeLogic JavaFX GUI

sbt stage
target/universal/stage/bin/shapelogic
or on Windows
target/universal/stage/bin/shapelogic.bat

ShapeLogic Scala has a simple JavaFX GUI, it can:

Status

Short Term Goals

Long Term Goals

ShapeLogic Scala goal is be a framework for object recognition using a hybrid approach to A.I. combining machine learning and symbolic A.I. Using some of the following techniques:

First example will be OCR, optical character recognition for a page of text. It is a solved but nontrivial problem.

Convolutional Neural Network

The success of Convolutional Neural Network is indisputable. ShapeLogic intend to use CNN for lower level pattern matching not for end to end solutions. Either using TensorFlow's Java interface, Deeplearning4j or hand programmed pattern matches.

BufferImage

ShapeLogic Scala has a unified generic image class BufferImage that is mainly a buffer.

If you want to program your own image operations here are 5 base image operations you can start from:

Generic Image What is the Big Deal

There are a lot of challenges with creating a generic image class like BufferImage:

ShapeLogic History

ShapeLogic Java was started in 2007 as a Java image processing library and library for functional programming techniques in Java. Functional programming now has better implementations in Java 8 and Scala. ShapeLogic Scala was started in 2016 and ports parts of ShapeLogic Java.

Image IO and Dependencies

The goal is to keep library dependencies for ShapeLogic low. Currently the images loaders are using javax.imageio and JavaFX. They are only part of Oracle JDK not on OpenJDK.

Example of Running Command Line Scripts

Threshold:
sbt 'run-main org.shapelogic.sc.script.Threshold -i "image/rgbbmwpng.png" -t 10 -o "image/out.png"'
or
target/universal/stage/bin/shapelogic -main "org.shapelogic.sc.script.Threshold" -- -i image/440px-Lenna.png

Who Do I Talk to?