15-463: Project 3: Morphing Some Faces
Student: Kristin Siu (kasiu)
Implementation
Again, the implementation was in Matlab.
Algorithm Outline
The basic outline can be considered as follows:
- Takes input images and a list of predefined points This list of
points was precomputed before hand using ginput and related
functions.
- Computes the triangulation by looking at the average of the points
and using Matlab's delaunay function.
- For each frame:
- Computes the dissolve and warp fractions.
- Calls the morph function using the two images, their
point lists, the triangulation, and the fractions.
- Computes the warped mesh by linearly interpolating the
two point sets.
- Splits the frame into two components: one from each image.
- For each pixel of each component:
- Calculates its corresponding triangle in the old
images and computes an affine transform for each
image.
- The affine transform is computed by finding
transforms from the identity triangle to each triangle
and combines these transforms (and their inverses)
to come up with both the affine transform and its
inverses.
- Uses the affine transform to get the value at the
pixel from the original image. Uses nearest-
neighbor interpolation for speed.
- Cross dissolves the two components to get the frame.
- Outputs that frame to a file.
The Mean Face
For the mean face, I modified the morph function a bit (the warp_frac is
effectively now 1 and the set of points im_2 is just the mean set of
points) The morph function now just returned a warped image, which was
then cross-dissolved outside of the function.
I ran out of time to come up with points for everyone's face, so my
solution uses only those people who had corresponding text files (or ones
that I could match).
Issues
I was unable to get either of the C files for the mytsearch functions to
compile and then spent the project using mainly the really slow mytsearch.m
version of the code. As a result, my code is slow. Really slow.
There are also was some unusual artifacts in the morph, so it doesn't look
too great. Part of this problem was the points I specified (I believe the
eyes on the point set for my face are a little too low (as in, I think I
specified the eyelids instead of the eyebrows)... Oops.
Also, the poorly-defined triangle mesh and interpolation badness (using
nearest neighbor only) have left an ugly border where the mesh borders
are. This probably could have been remedied by encompassing the rest of
the image into the mesh (points at corners) and using a better
interpolation scheme.
Results!
Face Morph
The following is the video of the face morph from my face to Luis's face
(pictures 16 and 17 respectively).
Original pictures:
Here's a link to the video.
The Mean Face
Here is the mean face:
And here is my face warped to the mean:
For some reason, I think I'm a little horrified at how I got stretched
out... Am I really that different from the mean?
References/Credits
Errr....thanks to everyone in the class who had a photo?