Sunday, June 7, 2009

xmorph

xmorph & gtkmorph

The two programs xmorph and gtkmorph are the GUI (graphical user interfaces, that is, front-ends) to libmorph, a library that implements digital image warping , known as morphing.

This is a brief review
  • Hosting
    The project for all of the above programs is hosted in SourceForge, and is called xmorph.
  • Source code
    The source code is distributed in the web page of releases, as one single tar file called xmorph_yyyymmdd.tar.gz.
  • License
    All the programs and codes are open source: they are subject to the GNU General Public License
  • Windows binary
    A binary of gtkmorph for Microsoft Windows platforms is available for download in the same page; the newest version (since July 2004) come in a .exe automatic installer (thanks to A.Profeti) , and it needs GTK libraries for Windows, to be downloaded and installed separately: read the INSTALL.htm file.
  • Linux binary.
    Binary packages for Debian GNU/Linux are currently available in Debian: just type "apt-get install xmorph" or "apt-get install gtkmorph".
    Binary packages of xmorph are available in most distributions, such as SUSE and Mandrake, but unfortunately they are outdated, and gtkmorph is not available (which is a real pity).
  • NEWS
    The (low traffic) mailing list xmorph-herald features news on xmorph et al.: announcement of new releases, description of features, usage tips, users q/a ...
  • TODO
    In the future, there are plans for a version of gtkmorph that will do 3D morphing.
  • HELP
    Unfortunately the current code has lost the GIMP plugin: help is needed.

morphing

From the README, by M.J.Gourlay:
Morphing was invented and first used by Industrial Light and Magic. The original author of the first morphing algorithm is Douglas B. Smythe. If you can get ahold of the article, read Douglas B. Smythe's article A Two-Pass Mesh Warping Algorithm for Object Transformation and Image Interpolation'', ILM Technical Memo 1030, Computer Graphics Department, Lucasfilm Ltd., 1990. This kind of morphing is technically nothing more than a simultaneous warp and dissolve (see example) of an image. Another kind of morphing, which is far more involved than what xmorph does, uses 3D models of the two things being morphed.
The first commercial use of morphing was in a sequence in the movie
Willow. Since then, morphing has been widely used. Among the more memorable morphing sequences are those found in Michael Jackson's ``Black or White'' video, and in the movie T2.

Be sure to read George Wolberg's
Digital Image Warping. I have corresponded with George Wolberg about this program. I asked him whether he considered xmorph to be a violation of copyright of the algorithms in his book, since there are similarities. Mr. Wolberg assured me that my algorithms were different enough that there was no problem, and he seemed very interested and enthused about the existence of my public domain implementation. Also, the algorithms published in Mr. Wolberg's book had bugs in them which I and other xmorph contributors have found, and those bugs have been reported to George Wolberg, who verified my corrections to be proper. I was also told that these bugs were propagated on to Lucasfilm, although I have heard from no one at Lucasfilm directly.

libmorph

A.Mennucci: In Nov 2003, I have reviewed some of the libmorph code; I have changed the morphing routines , to this end:
  • in the older code, meshes must have the border on the image border; now the border of the mesh is free to move
  • the old warp algorithm works on the original image, and pushes the pixels from the original image to the warped one; the new code works on the warped image, and pulls the pixel from the original one;
  • for this reason, I have rewritten the resample algorithm: there are two routines now,
    • bilinear sampling: reasonably good, 5 times faster than the antialiasing
    • antialiasing sampling: very high quality (dynamic lanczos kernel); recommended for animations, for images with fine grain and texture, for the final results of your work; even for still images, it produces sharper images than the above (in all of my tests)
for more info, read the slides (from HBES 04), or see this example image

gtkmorph

gtkmorph: Written and Copyright (C) 2000-2004 by A C G Mennucci

This GUI uses the GTK libraries. It is more advanced than xmorph, since
  • it can morph multiple images at a time
  • it can add and remove lines to the control mesh
  • points in the mesh can be labelled as being part of features (think: nose, mouth, hand...); then the features can be
    • moved as a single object
    • distorted (but this needs some work)
    whereas the non-labelled points are automatically smoothed by the program, using an energy derived from thin plate spline theory: this way, meshes can have many many points
  • points can be adjusted to a subpixel precision, using a magnifier lens
  • it can make movies in GIF, MPEG2 and MPEG4/DIVX format (by using external programs such as imagemagick and mencoder)
  • it can read many different image formats
  • it can select a subpart of interest of the loaded images (think: calibration)
  • it can choose between 'bilinear' and 'antialiased' morphing
  • it can enhance the morphs using a wavelet-based algorithm
  • it has a wizard, called guide, to help first time users
You may also read the slides (from HBES 04) where the above improvements w.r.t. standard morphing are discussed.
gtkmorph has been succesfully used in real world application, for research in Neurophysiology; it may be used in general for research in Geometric Morphometrics. Some selected publications:

xmorph

xmorph/morph/libmorph: Written and Copyright (C) 1994-2000 by Michael J. Gourlay

The original xmorph web pages (by M.J. Gourlay) are not hosted at Colorado research any more; a copy can be found here; but all links referring to other subjects are broken.
The original web pages contain examples and tutorials for xmorph.

download