Line Correspondence Editor
In order to specify a morph as described in the Beier-Neeley paper you need a way of defining line correspondences -- that is, a set of pairs of lines in the two images that indicate the position of corresponding features (i.e. nose to nose, upper lip to upper lip, etc.). The morphing algorithm uses these pairs of corresponding lines to compute the morph at each frame in the transition.

We provide an interactive program (morphlines) that should help you specify these line correspondences between image pairs. You have received the source code for this program in the file, which should compile according to the instructions provided. However, in a pinch, you could download an executable for Windows or Mac OS X and run it instead.

The program provides a simple interface that lets you click points in the two images to specify pairs of lines and then lets you save these line correspondences to a text file that can be loaded within the body of your main program (see the function imgpro.cpp::ReadCorrespondences()). A screenshot of the correspondence editor is shown below. Each line in the left image has an associated line in the right image (colors indicate correspondences, and dots indicate the start of the line segment-- since orientation is important). This set of lines shown in this example is available here. It will define the correspondence used as input for a Beier-Neely morph between these two images.

(image of Arnold Schwarzenegger is credited to Jim Greenhill, Wikipedia)
This application is started from the command line with the command shown below. In this example, the application loads the images 'image1.jpg' and 'image2.jpg' and stores the created line correspondences in 'output_correspondences.txt'. The optional argument '-input_correspondences initial_correspondences.txt' is an existing text file that contains line correspondences in the format created by this program and read by the function main.cpp::ReadCorrespondences (this allows you to edit the same set of lines several times).
morphlines.exe image1.jpg image2.jpg output_correspondences.txt [-input_correspondences initial_correspondences.txt]
When the program starts up, you will see the first image on the left, and the second image on the right. The images are shown at their original sizes, and so you should not use images that cumulatively are bigger than your screen (the program will probably abort with an ugly error).

You can create lines by dragging the cursor with the left mouse button down. Lines are colored by the order they were created (per image), and so lines with the same color are in correspondence (however, note that there are only 24 colors and so they are re-used after a while). You can delete the last line by hitting the 'd' key or Delete key. This operates like an `undo' command -- if you don't like the last line you created, simply delete it and draw it again.

You exit the program by hitting the `q`key or the `ESC' key. It is important that you exit the program this way (rather than simplying closing the window) because then the lines you created will be saved to the filename that you gave on the command line. You can also save your lines at any time during execution of the program by hitting the 's' key.

Should you encounter any problems/bugs with this application please post them on Piazza.
Quick command summary:
  • Drag left mouse button -- create line
  • 'd' or Delete key -- delete last line
  • 'q' or Esc key -- save lines to file and exit
  • 's' key -- save lines to file and continue