Extract Curves

Contents:

  1. What Does It Do?
  2. How Come?
  3. Features
  4. Installation
  5. The Graphical User Interface
  6. Ruby Forge Project (http://rubyforge.org/projects/extract-curves/)

What Does It Do?

It occasionally happens that an instrument for accessing a charecteristic of a physical-geometrical process interacts with it to mirror the cherecteristic in not a simply-extended manifold, but rather—a continuous doubly extended one. It can also happen that inside this doubly-extended manifold, there is a simply-extended projection of another characteristic process which can present the basis for the provocation of a hypothesis in the mind of an observer, a hypothesis, the testing of which can require a precise comparison of the charecteristic process with a normalized one. Extract Curves is a simplistic symbolic machine (piece of software) which can help with the isolation and projection onto a data process, more easily accessible by a computer, of image blobs (presumably being the projections of simply-extended charecteristics of the doubly-extended charecteristic process) and their elements.

How Come?

There is a friend and teacher of mine by the name of Boris Komitov from my home town with whom I would often collaborate when I am in touch with him, and who possesses a moving interest in what appears to be the inspiration of all physical science—the astrophysics of, especially, what lies above us, as, especially, can be seen, for example, on a clear night. It has often happened over the past years that he would have the representation of a good chunk of a physical process in graphical form (as for example, the effect of a printing machine driven in accordance with the process, represented by a certain single-argument physical-geometrical function, on a sheet of paper) to which he would like to perform a sequence of symbolic (arithmetic) manipulations to see if its projected result on the arithmetic system is allowed by a certain hypothesis of his, or, sometimes, to use the projected result to produce a hypothesis, without a having a pre-existing one. For this operation, however, the projection of the chunk of the known process on the arithmetic system is necessary, the performance of which projection, can be fairly unwieldy, in case the known charecteristics of the process are only represented as in the example of the effect of a printing machine on a paper sheet.

The precedent for Extract Curves has been Readgraph—an elementary symbolic machine that thansforms bitmap image representations of a graphing process that proceeds simply in the horizontal direction into a text file, fairly easily accessible to computer arithmetic. Recently, however, has my friend desired to look at the time series of the shape of Mars's north polar cap and check for a symbolic statistical relationship between this time series and the that of an index of sun's activity to investigate a supposed relationship between the effects of sun's radiative processes and that of Mars's climatic processes. It happens, however, that the process of change of Mars's north polar cap is only accessible as the effect of relevant digital photographing of space probes. It is, thus, requisite to isolate the projection of the polar cap from the resulting photographs and further project a charecteristic of the isolated object on a something easily accessible to a computer's arithmetic system. The hypothesis of simple horizontal extension is no longer corresponding to the necessary operation, and a more precise machine is necessary.

Features

  1. Blob detection (color-based in RGB and HSV schemes)
    Example: If you see the logo above, you can see the a enhanced after detection.
  2. Blob contour carpet extraction
    Blobs can have from one to any number of separate contour elements depending on their connectedness (for example, an o has an inner and an outer element). Further, these contour elements can have more than one loops. (For example, an 8-like shape in which the boundary just touches itself at the center, but it is still possible to traverse all of the figure's inner side with a single linear process withour crossing the boundary, has an inner contour element of two loops (the third, composite, one is not counted). In Extract Curves's context, contour elements are called loop carpets.)
    Example: In the logo thay you may see above, the c has been detected, its 8-neighbor-based contour has been extracted, thickened and marked.
  3. Midline extraction (and extraction of corresponding contour segments)
    Example: In the logo that may be displayed above, the t has its midline marked.
  4. Skeleton pruning (shaving)

Installation

Extract Curves is written in Ruby with some extensions in C. It uses the RubyGems package management system. The only currently available packages are gems. You would therefore, need to install RubyGems on your system before you can install Extract Curves. You would also need Ruby-GTK2 from the Ruby-GNOME2 project.

Linux

After installation of Ruby, RubyGems and Ruby-GNOME2, you can use the -i586-linux gem which contains i386 extension binaries, or you can use the source gem.

Debian example:
shell# apt-get install ruby1.8 libgtk2-ruby
shell# wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
shell# tar xvfz rubygems-0.8.11.tgz
shell# cd rubygems-0.8.11
shell# ruby setup.rb
shell# gem install -r extract_curves

Latest i586-linux gem: http://rubyforge.org/frs/download.php/7622/extract-curves-0.1.1-i586-linux.gem

Windows 32

You can follow the Ruby-GNOME2 windows installation instructions for the installation of all you need before you can insall Extract Curves by installing the -mswin32 gem, as in the following example, or comipling the extensions in the source gem.

Example (in a DOS promt):
C:\> gem install -r extract_curves

Latest mswin32 gem: http://rubyforge.org/frs/download.php/7623/extract-curves-0.1.1-mswin32.gem

Source Gem

After installing the run-time software Extract Curves depends on, you can install the source gem (no suffix) and compile the extensions for your operating system and hardware architecture, for which you would need a C compiler and the GTK 2 development libraries. The extensions you need to compile are in the ruby_ext/pav subdirectory under the gem root. There is an extconf.rb script that is used to generate a Makefile for your operating environment. So the general instructions are to execute in the ruby_ext/pav directory:

shell# ruby extconf.rb
shell# make

Latest source gem: http://rubyforge.org/frs/download.php/7621/extract-curves-0.1.1.gem.

The Graphical User Interface

The second release of Extract Curves uses a strategy for building its GUI which is a subset of an earlier idea of mine which I called Parsed Input Process Initiator (which was probably something the people at PARC, developing the GUI strategy, were looking at). The GUI widgets that are presented to the user are autogenerated to mirror the relationships between objects, methods and arguments of the Ruby program of which the GUI is an interface.

In the left pane of the main Extract Curves window, you will see a tree structure of objects, methods and arguments. Objects appear as a row containing an icon or label, followed by methods which don't return an interesting result, but which have useful side-effects (like saving an object to a file). Below this title row are methods which return other useful objects.

Used object icons:
Blob
Contour carpet (a loop carpet with its member loops)
Loop carpet
Loop
Curve carpet (produced by skeletonizing a contour carpet and may contain a number of separate curves, e.g. one per loop, if skeletonizing was done with the multiple curves option)
Curve

A method appears as a row of a button to call the method, followed by appropriate widgets representing its arguments. Objects resulting from calls to the method accumulate as its children in the tree hierarchy.

RubyForge Project

Visit http://rubyforge.org/projects/extract-curves/.