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

This is the first release of the morphing program. The program is far from complete, but it should be useable enough to get a feel of how the morph can be specified and the type of result that you can get.

There are many rough edges, and installation/starting the program aren't especially user-friendly at the moment.

This program should work on any platform supporting a Jave Runtime Environment, but where platform-specific instructions are given a Windows PC is assumed. Other platforms are likely to use similar methods to those stated.

Version

(Still trying to think of a program name)
Release 1
Build 0.1.20031013
Pre-release modifications 14/10/2003

Downloads

Main program (394KB, ZIP archive)
ImageToolkit for Java Advanced Imaging (4KB, Java class)

Requirements

This program requires a computer with a recent Java Virtual Machine 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.

Main Changes

Initial release - no changes since previous release.

Installation

To use this software you must have Java 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.

The basic image saving options are only supported by the Java Advanced Imaging (JAI) Tolkit. If you want to save your morphed images correctly then you will need to download this from http://java.sun.com. It is hoped that later versions will not require this additional download. If you decide not to download it then a basic image saving facility still exists, but the colours on the saved images are not what you might expect.

To install the morphing program:

  1. Download the main program (a ZIP file - it is intended that later releases will be JAR files)
  2. Unzip the file to a memorable location, e.g. U:\morphing\
  3. If you have downloaded the JAI Toolkit then also download the ImageToolkit for JAI
  4. file and copy it over the file with the same name in (program location)/data/uk/org/ghweb/graphics.

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 a PC go to (program location) and load the start.bat file.

If for some reason this doesn't work, then you will need to start Java and tell it to load (program location)/data/Morpher1.java. 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)\data\"
(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.

Please note that there is no need to worry if you see a window appearing with lots of text. This is solely for debugging purposes and shouldn't concern the end user. In future versions this should be suppressed.

Instructions in Brief

Interface

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.

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 edit mode. The line nearest the mouse pointer will be highlighted in red on all images. When the mouse is near eaither 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 red. The line will appear blue (when it isn't the nearest line to the mouse). 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. This will create a mid-way morph between Image A and Image B. Morphing is a computationally intensive process, and it may take a few minutes for the image to appear. A copy of the generated image will be saved as morphresult.jpg in (program location)/data - if you want to keep this image then create a copy or rename it as subsequent morphs will overwrite any existing file.

Features

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
  • Image loading/saving
  • Image-feature loading/saving
  • User-specified frame of morph
  • Batch processing for consecutive frames

Some Other To-Dos (Very abbreviated list)

  • Improve image display speed
  • Improve rendering speed where possible
  • Major interface changes including selection facility
  • Exit button
  • Menu bar
  • Control over the weighting function for improved morph quality

Known Bugs

  • 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.
  • Button and toolbar borders overlap, some other display glitches.
  • Unspecified morphs generate black images.

Feedback

I am keen to hear any feedback you have (although in this early release I have a good idea about what needs to be changed). Please contact me with any comments.

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