Bradley Qu
CS 194-26: Project 4
Face Morphing
Introduction
Time to morph faces! Using a simplified mesh model of faces, we can morph from one face to another. Using similar methods, it is possible to transfer feature differences between faces to another face. This is what is used to generate a gender transferred image. Amplification of these features can also generate characatures.
Face Morphing!
Face morphing is a relatively simple process that mainly requires good choice of control points and images. I start with two images that I want to interpolate.
|
|
I then select control points by outlining corresponding features on two faces. Most of the challenge in this part was here, writing the tools to efficiently label control points. It is also critical to choose points so that the delaunay trianglulation of the average spawns edges along the feature edges rather than across them.
|
|
Since the two images now share
a triangulation, I can interpolate between them. The following is the midpoint image as well as the components
from both sides that contribute to it. Notice that there are significant artifacts in the component images. This
is the result of poor selection of control points. Also notice, however, that the averaging of the two images
make the artifacts less noticable.
Finally, the result!
Face Averaging
Instead of averaging two images, it is also possible to average a batch of images.
I averaged 200 images from the FEI face database.
If I save the average
image and its control points, it is possible to warp any image to the shape of the average and visa
versa. It is also possible to create a caricature by amplifying the difference between my image and
the average. Here is an example with my face:
Changing Gender
Similar to the
caricature, it is also possible to add a difference component to a different image. This method
can be used to change the genders of faces. Find the difference between the average male and
female face. Save this component and add/subtract it from any face to change its gender.
There is
also, however, a difference in texture between a face of a woman and that of a man.
This can be reflected by transforming both the average man and woman into the shape of
the target face and adding and subtracting their textures accordingly. In my case of
man to woman, we do image + (woman - man).
Notice the
artifacts around the head. This is due to misalignment of the hair of the averaged images
after transformation. This is minimized with a squared divider on the magnitude of the
color change. This and some additional touch-ups in a photo editor can produce a better
result.
Antialiasing and Mipmapping
Bilinear interpolation
helps in reducing aliasing when transforming, but it is not perfect. Namely, if the sampling frequency
is more than one pixel, aliasing can still occur. This can be avoided by precomputing the sampling
frequency along each transformation axis. We can then downsample the image to artificially create a
sampling frequency of 1. This process is called mipmapping.
The following are samples of original faces from the set and the transformed version.
Notice how the mipmapped
image has significantly smoother diagonals as opposed to the image without it.