CS633
Spring, 2008
Programming Assignment 3 (40 points)
Due: April 25 (Friday)
------------
3D Morphing
------------
1. Problem Description
In this programming assignment, you are required to develop both
"coordinate grid" based and "feature" based approaches to perform
morphing on two given images, a source image and a destination
image.
The command line for the execution of your program should
be as follows:
prog3 image1 image2 k
"prog2" is the name of the executible, "image1" is the name
of a source image file, "image2" is the name of a desti-
nation image file, and "k" is the number of intermediate
images to be generated during the morphing process.
Once executed, your program should display a layout as follows
on your screen:
__________________________________________________________
| __________ __________ _____________ _________ ________ |
| | Choose | | Source | |Destination| | Start | | Stop | |
| | Method | | Image | | Image | | | | | |
| ---------- ---------- ------------- --------- -------- |
|________________________________________________________|
| |
| |
| |
| |
| |
| A |
| |
| |
| |
| |
| |
|________________________________________________________|
The five small rectangular areas (with different colors) should
again act as menu items (buttons). The first (left most) area
should act as a pull-down menu button so that when it is clicked,
the user can select a morphing approach: "coordinate grid" based
or "feature" based approach. Clicking in the second rectangular area
will bring up the source image: image1. This image should be shown
on the left half of the working area, as follows. If the "coordinate
grid" based approach is selected in the previous step, the user
should then click at (m x n) points to define a grid on this image.
Otherwise, the user should then input a set of arrows to specify a
set of features of the source image: image1. Each arrow is defined
by two points. The first pair of points input by the user defines
the first arrow (the first point is the start point and the
second point is the end point of the arrow), the second pair of
points input by the user defines the second arrow, ... . The input
phase is terminated by clicking the middle button of the mouse.
__________________________________________________________
| __________ __________ _____________ _________ ________ |
| | Choose | | Source | |Destination| | Start | | Stop | |
| | Method | | Image | | Image | | | | | |
| ---------- ---------- ------------- --------- -------- |
|________________________________________________________|
| | |
| | |
| | |
| | |
| | |
| show | show |
| Source Image (image1) | Destination Image |
| here | (image2) here |
| | |
| | |
| | |
|____________________________|___________________________|
Clicking in the third small rectangular area brings up the destination
image: image2. The image should be shown on the right half of the
working area, as above. The source image and the destination image
should be of the same dimension. The user should then either click at
(m x n) points to define a grid on the destination image or input a
set of arrows to specify a set of corresponding features on the
destination image. Obviously, the number of arrows specified for image2
must be the same as the number of features specified for image1. The
input phase is terminated the same way as the source image.
By clicking in the fourth small rectangular area, the user starts the
static morphing process (in either the left half or the right half of
the working area) and by clicking in the fifth area, the user terminates
the morphing process. The morphing process should be performed with "k"
intermediate images where "k" is the number of intermediate images
specified in the command line. Note that once an intermediate image is
displayed, your program should wait for the the user to click the left
button in the display area before showing the next intermediate image.
You can either use the images provided by me (can be downloaded
from my web page, the links are right underneadth this programming
assignment) as the source and destination images, or use your own
images as the source and destination images.
For simplicity, I suggest that you all use the same format: bmp.
Programs to read and display a bmp file are provided below.
(memBMP.cpp)
(memBMP.h)
In your program, don't use 'bool'.
Instead, define your own 'BOOL' as follows:
#define BOOL char
#define false 0
#define true 1
Besides, don't use '#include ', '#include ' or
'#include' on the CS domain. They only work for the
Windows platform.
Reference:
---------
T. Beier and S. Neely,
Feature-Based Image Metamorphosis,
Computer Graphics (SIGGRAPH Proceedings), 26,2 (July, 1992),
35-42.
Note: The book has a program for this project. But do not use it.
It is wrong.
2. What to Turn In
Mail your program (in one file) to "cheng@cs.uky.edu" on or
before the due date. Then come in during my office hours between
4/24/2007 and 5/1/2007 for a demo.