CS426
Assignment One: Morph

Assigned 9/23/98
Due 10/4/98 11:59pm
15 points

The purpose of this assignment is to create a morphing program. Morphs are used for special effects in movies and advertisments to give the illusion of a metamorphosis from one figure to another. Our project is based on the original morph described by Beier and Neely at Siggraph in 1992 (download 7.4Mb PDF) The user interface will be implemented in RapidApp and Inventor. The Inventor code is provided for you, as is a simple interface built in RapidApp. You are encouraged to build a better RapidApp interface on your own, after you are done with the required parts of the assignment.

Getting started
To get started, download the user-interface, or (if that doesn't work) make a copy of the directory (in MECA

/u/cs426/projects/project1.tar.gz

These files may be unpacked in your directory by typing:

% gunzip project1.tar.gz
% tar xvf project1.tar
% rm project1.tar

The first thing to try is to run the supplied demo program:

% runMorph
  From the File menu, select Open and load in min_em.cfg. Look here for a description of the user interface. Try looking at a few intermediate images & warping grids ...

Now try compiling and running the provided UI skeleton:
% make
% morph



Required features (10 points total)
1.  Implement the part of the user interface that manages the line pairs used for morphing.
2.  Implement the saving and loading of the configuration file. See the hints page for details on the file format.
3.  Write code to perform line segment interpolation (using endpoint interpolation)
4.  Implement the direct and inverse mapping functions (in the Beier/Neely paper these are called forward and reverse mapping respectively).
5.  Implement the morphing code. See the Beier & Neely paper.
6.  Allow the user to choose between viewing the morphed image, the initial image warped to the intermediate position of the lines, or the warped final image. The user should also be able to toggle the display of the feature lines in the middle window.
8.  Make two movies, one showing a morph from you to the next person in the class and another one from the previous person to you. We will send out picture assignments next week.

Optional features
The following list shows the optional features in order of increasing difficulty. The number in front of an item indicates how many points it is worth.
(1)  Replace the provided GUI with a better one: either use this recipe to create a GUI with resizeable windows, or design your own using RapidApp.
(1)  Implement better line interpolation, using center, length and orientation interpolation
(1)  Add a button to fade out images, in order to see the feature lines better.
(1)  Preview mode. Since computing morphed frames takes quite a while, allow the user to have a faster,lower quality mode in which the morphed image is computed at a lower resolution.
(1)  Add a menu toggle saying whether or not to use lines on the edges of the images when doing the morph. These lines would try to keep the warped images rectangular. They could have low weight and fast drop-off to avoid influencing the user-drawn lines.
(1)  Run the profiler on your program to see where most of the time is spent. Suggest ways to make your program faster. You should hand in a writeup of your evaluation, as well as any performance improvements you were able to make.
(2)  Add a GUI feature that would allow the user to change the morphing parameters (a,b,p) associated with a given line pair
(2)  Allow points instead of (or in addition to) lines, for specifying feature correspondences.
(2)  Display a progress bar when writing a movie. The bar should be updated at least after each frame is computed.
(2)  Antialias by supersampling (possibly jittered) - see Foley.
(3)  Use the Image Format Library (see man 3 IFL) to be able to load and save arbitrary image formats.
(5)  GUI and back-end to allow users to edit two video clips, rather than just still images.
(?)  Any other feature you find interesting. Ask a TA if you want to know how many points it is worth.

Hints
Keep an eye on the hints that will appear during the course of this project, from frequently asked questions, precepts, etc.


Credit

Each item on the list above shows the number of points available for implementing the optional features described. Partial implementations will receive partial credit. To receive "full credit" for the assignment, you will have to implement all the required features (10 points) as well as 5 points worth of optional features. If you receive close to the equivalent of full credit for all your projects you will get an A for the class.

To get extra credit on the assignment, you may choose to implement more optional features. These point values are somewhat fuzzy in that you can do an amazing job and get significantly more than the value here. Likewise, you can do a shoddy job and get less. Also, please don't worry about somebody ``blowing the curve'' by doing everything. We'll have a reasonable upper bound on the grades.


CS426 | CS Department | Princeton University