The University of Sheffield Department of Computer Science
The University of Sheffield Department of Computer Science
Face Morphing:
An Undergraduate Project by Graham Haynes (Supervisor: Steve Maddock)

Release Notes

Contents

Introduction

Release 5 adds several new features (particularly in the rendering dialogue), fixes a few bugs, introduces file loading, saving, and batch image rendering, and allows greater configuration of the morph. This version takes on board comments from previous releases.

Note that some of the features in this version are slightly buggy. I have taken the step of releasing this version as I believe it offers benefits over previous versions. The bugs haven't been ironed out as I plan to reimplement much of the problem code in the next version, which should operate under a multiple document interface. Once this is sorted then I will be able to start work on the template system.

This program should work on any platform supporting Jave Runtime Environment version 1.4 or above, but where platform-specific instructions are given a Windows PC is assumed. Other platforms are likely to use similar methods to those stated. Instructions are also available for using the morphing tool on the MacLab computers.

Version

(The next version ought to have a name)
Release 5
Build 0.5.20031107

Downloads

The files are now stored in a JAR archive. If you have a version prior to release 3b then you might find it beneficial to delete your previous installation before installing the current version.

Main program Release 5 (429KB, ZIP archive containing JAR file)
Main program Release 5b (429KB, ZIP archive containing JAR file)
Sample project (601KB, MPP morphing project)

Requirements

This program requires a computer with Java Virtual Machine version 1.4 or higher installed. Due to the amount of graphics and computation involved it is preferable to be using a fast computer with a fair amount of free memory. Note that when rendering the computer may appear to freeze for several minutes. This is normal.

Main Changes

  • Further minor bug fixes
  • Less files in the zip archive - now you need only extract the JAR file and sample images
  • Keyboard shortcuts (partially implemented), including the delete key to erase a line
  • Project loading/saving
  • Frame loading/saving
  • Customisable preview render (can take as little as 1/2 second) with automatic option
  • Weight controls
  • Properties and settings with memory (partially implemented)
  • Ability to show start and end image in render dialogue
  • Line display toggle in render window
  • Batch rendering - specify the number of frames and a base file, and the program will save a sequence of frames (e.g. 11 frames for 10% intervals)
  • Possible error reporting (possibly buggy)
  • Attempted speed ups to the morphing process (with negligible effect)

This release adds many features which should make the program usable for the purposes of the Psychology department (except for the file bugs which I mention below). The next version will (hopefully) contain a multiple document interface (each image apperas in its own window), and the following release is intended to allow basic templates.

As I now consider this software to be usable I am slowing down work on programming it so that I can concentrate more on other aspects of the project. As I have mentioned, this version introduces some bugs with its new file loading features, but if you discover any more or require any features not yet in this version then please let me know so that I can prioritise accordingly.

Also, because of the new features added, this version is less intuitive than some previous ones. Once I have the MDI I working I will include a brief graphical user guide/tutorial with the next release.

Installation

To use this software you must have Java 1.4+ installed. You may already have this. If you are able to install software on your computer then you can download the latest version of Java from http://java.com - look for the download of the Java Runtime Environment (JRE) or Java Virtual Machine (JVM). This should exist on Managed XP systems.

To install the morphing program:

  1. Download the main program (a ZIP file)
  2. Unzip the file to a memorable location, e.g. U:\morphing\

You can safely install the current version over any previous version, although you may first want to delete old files to reduce clutter and confusion.

Usage

Managed XP

  1. First load the application menus using the Start menu.
  2. Once the menu becomes available select Start/Applications/CIS/JRE 1.4.2. If this is the first time this program has been run on your computer then you may have to wait several minutes while it is distributed.
  3. Continue with the instructions below.

Own Computer

To start the program on almost any Java platform go to (program location) and load the start.jar file.

Failing that:

If for some reason this doesn't work, rename the start.jar file as start.zip and decompress its contents to (program location). Now try and run (program location)/Morpher1.class. You can typically do this by opening a command prompt (on a Windows PC click Run on the Start menu or look for a reference to Command Prompt or MS DOS in the program menus) and typing:

cd "(program location)\"
(driveletter): (if the prompt doesn't change to the program location)
java Morpher1 silent

The initial program window should pop up after a couple of seconds.

MacLab eMacs

See the separate instructions.

Instructions in Brief

Interface

These instructions have not been updated since the previous version.

The interface consists of a window with three images, labelled Image A, Image B and Zoom. Morphs are created between the first two, and the zoom image is an aid to picking out the points to morph. Images can be scaled by dragging the scale slider or (for Image A and Zoom) by dragging the dividers between the images.

If you wish to change the default images then go to the project menu and select the load option for the image you want to replace.

By default Draw mode is enabled. This allows you to draw features on the images. You can draw on either image, but you will probably find it easier to work with the larger one. To draw a line you can either click at the start point and then click at the end point, or you can 'drag' a line from the start to the end. When you draw a line on one image it will be mirrored on the other.

For precision control, use the zoom image to see exactly where the mouse cursor is. At the bottom right the co-ordinates of the mouse within the image are shown, along with a sample of the colour under the cursor and it's component values (red, green and blue, with each on a scale of 0-255).

You can click the Edit button to switch to line editing mode. The line nearest the mouse pointer will be highlighted in red on all images. When the mouse is near either end of a line a circle will appear. This means that the point can be dragged by holding the left mouse button down, moving it, and then releasing at the new position. Only the line on the current image (and zoom) is actually moved.

Lines can be selected by right-clicking when the desired line is highlighted, or simply by left-clicking when in selection mode. The line will change colour. Repeating this deselects the current line. You can select all lines using a third mouse button/wheel. Selected lines can be deleted by clicking the button marked delete.

A good way to edit images is to draw lines on one image, swap the images, and then move the lines to corresponding points on the second image. You can swap the images by clicking the swap button.

To generate the morph click the Render button. A new window will pop up. In this you can select how far between each image you want the morphed image to be, generate the image, and save a copy. To generate the morph click Render. You can also use the menus to generate warps (distortions of the source images). To save click Save Image and enter the name of a JPEG file. If you don't specify a standard extension then .jpg will be appended to the filename.

Note that morphing is a computationally intensive process, and it may take a few minutes for the image to appear after you click Render. The rendering time is roughly proportional to the number of lines, the width and the height of the image. Certain warps and morphs may be cached. This will reduce rendering time for some images. To cross-blend the two images don't place any lines and then render as normal.

Features

This section have not been updated since the previous version.

The lines you draw should mark out identical features on both images. You can think of each line as having a 'field of influence' so that points near a line will move with it. The area between two lines that move towards one another will be squashed and the area between two lines that move apart will be stretched - of course, as lines rotate they can move both towards and away from each other. You may need to experiment to decide how many lines to place and where to put them, but note that the rendering time is proportional to the number of lines on the image. You might want to use lines to trace contours, e.g. around the eyes, or more generally to set image ratios, e.g. a line connecting the centre of the two eyes.

Take care not to cross lines or make them rotate excesively (check that the line is oriented the same way as the corresponding line on the other image by checking that corresponding points are circled). Generally it is best to keep contour lines close but not touching, although the best way to get a feel for the technique is to experiment.

The nature of the feature-based distortions means that parts of the image beyond its bounds may be requested. These are taken as black points. As a result the useable part of the morphed image may well be less that that of the two input images. The best way to deal with this is to put in images larger than the desired resultant and then crop the final morphed image. If you wish to minimise these effects then try drawing a frame of lines around the boundaries of the images. (Keep the lines the same on each image). This will give the edges of the images a degree of 'stickiness', but will also affect the rest of the image. For a stronger effect you can double or triple frame the borders.

  • Note that many aspects of the User Interface are likely to change and these instructions may have little bearing on future releases.

Priority To-Dos

  • Bug fixes
  • Multiple document interface
    The MDI may result in the loss of the zoom pane. Please inform me if you find this useful or would like this to be kept.
  • Complete memory for settings, introduce load/save options, fit an 'apply to' option so that warps can return to being pure warps.
  • Complete keyboard shortcuts and try to get mnemonics working
  • Template system
  • Morph enhancements, including time estimation
  • Graphical guide

Some Other To-Dos (Very abbreviated list)

  • Background colour selection
  • Targeted and experimental enhancements following feedback
  • Implement the menu bar as a Dockable
  • Reorganise menus for greater Mac integration
  • Enable web applet functionality (low priority)

Known Bugs

  • Frame loading - lines do not behave as expected after loading a frame. Do not add any lines to a loaded frame. You can work around this issue by loading the frame, saving the project, and the loading the project back in (subject to the below constraints).
  • Project loading - lines do not behave as expected after loading a project. If you add lines to a project and then save the project you may find that the new lines replace the old ones. Until the next version it is suggested that you do not add lines to an existing project.
  • Warps are currently rendered as morphs due to settings issues. This is inefficient and should be resolved soon.
  • Under certain circumstances lines can be drawn outside the image being edited, and lines released outside this area may snap to unexpected positions.
  • Toolbars cannot be detached as this may cause a NullPointerException. Until this is resolved the context menus are also disabled, but dragging is not.
  • Cursor on Zoom panel may be slightly out from the actual mouse cursor's location.
  • Leftmost image may resize in a jump on first mouseover.
  • Mac: Colour indicator looks incorrect
  • Mac: Contrast mode draws blocks rather than lines (may be system problem)
  • Mac: Render window stops opening in this release - may be backing store problem

Feedback

I am keen to hear any feedback you have. Please contact me with any comments.

- Graham Haynes, 13/10/2003 - 07/11/2003
© 2003 The University of Sheffield Copyright | Website | Contact
The Department of Computer Science, Regent Court, 211 Portobello Street, Sheffield, S1 4DP, UK.