Table of Contents
The ShapeLogic plugin add the ability to create rule based programming under ImageJ, for categorizing particles and lines. ShapeLogic has a framework for functional and declarative programming, using lazy streams.
Currently there are 2 applications and a few utilities.
Color Particle Analyzer
This works directly on a color image and find gray and color average color of each particle.
Can run in different modes:
- Automatic mode finds background color using K-mean method
- Set background color
- Set foreground color
- It will find and categorize particles on a relatively uniform background then
- Trace the edge for the particles
- Vectorize them to polygons
- Annotate the polygon with geometric properties
- Categorize based on user defined rules
Currently there is only a example categorization, based on the aspect ration and color intensity. The syntax for the rules for this categorization is the same as for the letter match. See below.
Part of ImageJ sample image embryos.jpg
Output if mask option was checked
Set input parameters manual and automatic mode
Particle count dialog
Particle property result table
Since ShapeLogic 1.4 there is also a mean R, B and G channel for color images
ShapeLogic also contains a rudimentary OCR example that analyzes skeletonized lines and matches the to rules for capital letters.
This is a proof of concept not an attempt to make a The point was not to set up a
Call ShapeLogic → CapitalLettersMatch
You will see the skeletonized lines, and the vectorized polygon in gray lines
Result is presented as a dialog box with a letter match for each polygon
Rule for the letter A in the letter match example:
rule("A", POINT_COUNT, "==", 5., letterFilter); rule("A", HOLE_COUNT, "==", 1., letterFilter); rule("A", T_JUNCTION_LEFT_POINT_COUNT,"==", 1., letterFilter); rule("A", T_JUNCTION_RIGHT_POINT_COUNT,"==", 1., letterFilter); rule("A", END_POINT_BOTTOM_POINT_COUNT, "==", 2., letterFilter); rule("A", HORIZONTAL_LINE_COUNT, "==", 1., letterFilter); rule("A", VERTICAL_LINE_COUNT, "==", 0., letterFilter); rule("A", END_POINT_COUNT, "==", 2., letterFilter); rule("A", SOFT_POINT_COUNT, "==", 0., letterFilter);
There is a digit matcher that show how to make your own categorizer. Currently you have to do it in Java, but it is trivial to load the rules from database or flat file instead.
The user will be able to choose between handwritten rules and rules generated by machine learning for particle categorization. Starting in ShapeLogic 1.6 this will be ported to OCR. First machine learning technique is a multi-layer feed forward neural network that is trained externally but run internally.
Project web site http://www.shapelogic.org
Both source files and binary distributions can be downloaded here: http://code.google.com/p/shapelogic/downloads/list .