You can use ShapeLogic Java in different ways:
Testing ShapeLogic as a user is very simple and only takes a few minutes after ImageJ is installed.
ShapeLogic contains functional and declarative constructs that can be used independently of the image processing code.
To use this just download the shapelogic_-1.6.jar and add it to your class path. If running from command line: -cp .;shapelogic_-1.6.jar
For examples of how to use this to solve mathematical problems see Project Euler solution.
For more information see Particle Counter and Analyzer page.
Go to the shapelogic menu and select the macro CapitalLettersMatch, which does the following
If you already have a skeletonized lines you can also call Stream Vectorizer directly, which does the following
When you press CapitalLettersMatch or Stream Vectorizer an input dialog will prompt you for input:
DisplayInputDialog: If you uncheck this next time run CapitalLettersMatch this menu will not show up
DisplayResultTable: If this is checked you will see a result table with geometric features for each polygon
DisplayInternalInfo: Print out polygon, points and their annotations
UseNeuralNetwork: Use neural network for classification otherwise a rule set will be used
ShowFileDialog: If this is checked the user will be prompted with a file dialog to select categorizer setup file
CategorizerSetupFile: File path to the categorizer setup file containing neural networks, rules or column selection list
Dialog with results of match
Vectorized M with skeletonized letter in black and polygon in gray
For more information see Letter Match page.
If you need a different version of shapelogic_-1.6.jar, e.g. one compiled for JDK 1.7.
These jar file can be found on any Maven 2 repository:
E.g. commons-math-1.1.jar can be found here: http://repo1.maven.org/maven2/commons-math/commons-math/1.1/
Or they can be taken out of the shapelogicplugin1.6.zip
When you open ImageJ there will be a ShapeLogic menu containing commands.
You can get the binary distribution from the download page or compile it yourself.
Starting in ShapeLogic 1.0 it is simpler to make user define rules for matching for use in Letter Matcher or the Particle Analyzer.
Until ShapeLogic 1.5 this demanded programming. Now you just load the categorizer setup file src/test/resources/data/neuralnetwork/polygon_digit_recognizer_with_rules_print.txt containing some simple rules:
========== def 0 holeCount == 1 tJunctionCount == 0 endPointCount == 0 multiLineCount == 1 curveArchCount > 0 hardPointCount == 0 softPointCount > 0 ========== def 1 holeCount == 0 tJunctionLeftCount == 0 tJunctionRightCount == 0 endpointBottomPointCount == 1 horizontalLineCount == 0 verticalLineCount == 1 endPointCount == 2 multiLineCount == 0 softPointCount == 0 aspectRatio < 0.4 ========== PRINTS Category Points lineCount holeCount ==========
Add the ability of the user to define lazy data stream in the categorizer setup file.
The rule sets and neural networks that are now defined in categorizer setup file could just as well be defined in a database.
ShapeLogic is built using Maven 2.
This makes several build tasks very easy, and is recommended, but the code should run fine without Maven.
Currently the project is set up to work directly with Eclipse 3.3 - 3.4, NetBeans 6.0 - 6.5, Java 1.5, but you can use: IntelliJ, JBuilder, emacs or vi.
Check ShapeLogic out into a local directory.
Do a cd into that directory.
Run:
You will have to change the JDK target in pom.xml:
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build>