Overview
In this assignment, I worked with transformations and warping by creating a morph animation of my face into other people's faces.
Morphing
To morph faces, I chose the corresponding points for both faces and computed the mid-way face by first calculating the transformation matrix for all the triangles. I used the inverse warping method so the transformation matrix had the form: T = W*Im^-1, where W is a matrix with vertices of triangles from the warped image and Im is a matrix with vertices of triangles from the original image.
Then for all the pixels in the warped image, I used the corresponding transformation matrix (Im = T^-1 * W) to find the location on the original image and got the pixel value for that location using interpolation (interpolate.RectBivariateSpline in Python, which is interpolate.interp2d for rectangles). With this, I was able to get the mid-way faces for both images. Then I computed the average colors (cross-dissolve) to get the final morphed image.
Corr. Pts for my sister
|
My sister and I
|
Corr. Pts for me
|
There are some slight distortions in the background due to their dissimilarities but the face morphing turned out pretty good.
Mean face of Population
I used the Danish faces (33 men, 7 women - smiling) dataset for this part. Using the points annotated in the ASF files, I computed the mean shape, morphed all the faces towards the mean, and averaged the pixel values to get my mean smiling Danish face.
Mean Face
|
Original Face
|
Face with Average Geometry
|
Original Face
|
Face with Average Geometry
|
I also morphed the shapes of both the mean face and my face
to each other. It's interesting to see that faces with only the
shapes changed looks really strange but once you cross-dissolve,
the face doesn't look as weird.
Mean Face to My Shape
|
Mean/Me Avg
|
My Face to Mean Shape
|
Mean/Me Avg
|
Caricature
Caricatures are images that show the deviations from the mean,
where caricature = mean + alpha * (mean - image).
The caricatures become more outlandish when the mean face is more
similiar to the face you're finding the caricature for.
I used the average Danish face from above and an average Korean
face to create my caricatures, and the Korean mean face creates
stranger looking caricatures than the Danish mean face.
Mean Image
|
1.5
|
2
|
2.5
|
Mean Image
|
1.5
|
2
|
2.5
|
Ethnicity Change
I found average faces of different ethnicities online and warped my face into these averages. Here are some examples:
German
|
Me
|
German to average shape
|
Me to average shape
|
Average Appearance
|
Average Shape/Appearance
|
Me
|
More me
|
Mean
|
More German
|
German
|
Me
|
More me
|
Mean
|
More African
|
African
|
Morphing Gifs
Korean Female Average
|
German Female Average
|
West African Female Average
|
Extra: Morphing Video of My Dogs
I created a morphing video of my 3 dogs from when they were puppies to them now. I got tired of creating corresponding points towards the end, which is why there are so many images of my first dog but only 2 images for the last dog.
(Listen to your favorite music while viewing to make it a "music video"!)
Extra: Family Morph
I also create an average face of the members of my family (5 in total) and also
created a morph sequence of them (from oldest - my dad to the youngest - my brother).
Family Morph
|
Mean Family
|