ShapeLogic C++

ShapeLogic C++ is an open source toolkit for declarative programming, image processing and computer vision. Optimized for simplicity of programming. Started September 2008.


It is very simple to get started with image processing in Java due to the excellent open source software ImageJ. An environment similar to ImageJ for C++ does not seem to currently exist. ShapeLogic C++ is trying to flesh out some of the functions that ImageJ does for Java. Simplicity of programming is a main concern.

ShapeLogic is intended as a declarative framework for vision so that the user can get work done through rules instead of regular procedural or object oriented programming. For example, one should be able to make a list of rules for categorizing the shape of a particle in the particle analyzer. You put them in a database or a flat file, and the same rules should work for the C++ and Java versions of ShapeLogic.

One should be able to choose the programming language that has the libraries required for your given purpose, e.g. C++ for face detection or Java for medical image processing. Then rules can be set up using the chosen library.

Cross platform

ShapeLogic C++ has been tested under Windows and Linux, but should run most modern operating systems.

ShapeLogic C++ under Windows

ShapeLogic C++ under Linux


Optionally Eclipse CDT for IDE based build system

Development Status: Alpha

  • ShapeLogic? is in Alpha, as of version 0.4
  • Same code runs under both Windows and Linux
  • Contains some image processing algorithms
  • Contains a few brushes for drawing, sampling and point info
  • Unit test are setup
  • Builds can be done both with Bjam and Eclipse


2009/03/22 ShapeLogic C++ 0.5 released

  • Added binary thresholds operations
    • Threshold with fixed limit of 127
    • Adaptive threshold with a small block size of 3
  • Added morphological operations
    • Dilate
    • Erode

2008/11/14 ShapeLogic C++ 0.4 released

  • Images are now internally stored in OpenCV's IplImage format
  • More image formats: BMP, DIB, JPEG, JPG, JPE, PNG, PBM, PGM, PPM, SR, RAS, TIFF, TIF
  • Made a few OpenCV image processing algorithm available:
    • Canny edge detector
    • Flip RB color
    • Flip horizontally
    • Flip vertically
  • Made Boost Build Jamfiles that works both on Windows and other operating systems
  • First release with development status Alpha

2008/10/31 ShapeLogic C++ 0.3 released

  • Added 3 first brushes: Pen, Sample color, Point info
  • Fixed bugs causing ShapeLogic? to crash

2008/10/22 ShapeLogic C++ 0.2 released

  • Save images using GIL
  • Scroll big images
  • Display file name in window frame

2008/10/16 ShapeLogic C++ 0.1 released

  • Integrate FLTK, Boost, GIL, Google C++ Testing Frameworks, Boost Build
  • Minimalist GUI to load images and run image processing operations
  • Image processing code written in GIL
  • Tested on Windows and Linux

Future plans for ShapeLogic

Low hanging fruits for ShapeLogic C++

  • Make more OpenCV image processing algorithm available in menus
  • Make generic dialog to get parameters for algorithms
  • Optimize draw
  • Draw continues line instead of points
  • More pen sizes for draw
  • Change brushes to to have a class each brush, that takes parameters
  • Macro system

Reason for port from Java to C++

  • C++ still seems to be the main language for computer vision
  • There is a lot of good vision code written in C++
  • C++ is faster than Java for number crunching
  • Advances in the C++ language and tools is making it more competitive

Bjarne Stroustrup the creator of C++ gave an interview about the new features in the C++0x standard and TR1. C++ now has a lot of innovative programming constructs e.g. template meta programming, lambda functions, concepts and traits.

Problems with C++ port

There are constructs used in ShapeLogic that are missing or less convenient in C++:

  • Uniform cross platform GUI
  • Dynamic cross platform libraries
  • HashTable
  • Reflection
  • Garbage collection

If it turns out that it is hard to translate constructs, ShapeLogic C++ will not have the same functionality as ShapeLogic Java.

Organizing code under C++

The Java and C++ code will be kept as close as possible.

There is a separate Google Code project for the ShapeLogic C++ port. Code has been checked in to svn.