Atte | CS194 | Project 3

CS 194 | Project 3

Atte Ahmavaara

0

Above you see the final product of our morphing algorithm. Below are our beginning images:

1 2

Defining Correspondences

The first step was to define corresponding points on each image. I did this using Photoshop and simply hovering over pixels I wanted to designate as a point, and copying this point into a hashmap. I picked the points to outline major features the face and head, i.e. the eyes, nose, mouth, ears, circle around face, chin, hair, and neck. I also added a point in each of the corners so that the overall image would stay aligned. I used a total of 37 points per picture.

Here we used Delaunay triangulation to find an optimal triangulation scheme for our two given images. First we averaged the two images’ points, and then ran the algorithm on the calculated average.

Point Structure on Image A:

7

Triangulation on Mean Image:

3

Computing the “Mid-Way” Face

In this section we calculated the mid-way morph of our two images. We calculate the affine matrices from a given triangle A to another given triangle B by first designating an arbitrary point X as the origin (with X, Y, Z being the vertexes of the triangle) and translating the triangle so that this ‘origin point’ lies at the true origin of the coordinate plane. We proceed to designate the vectors XY and XZ as the basis vectors for this triangle. We calculate the affine matrix that transforms the triangle to a bijective triangle in the standard basis. We then repeat this exact process, except this time we calculate an affine matrix from the standard basis to the goal triangle. We matrix multiply these two affine transformations to get the final affine transformation matrix. We used an inverse warp in order to take care of any possible problems with holes, which we were able to do because the affine matrix was invertible.

Original Images:

4 5

Mid-Way Face:

6

Gif Demonstrating its Construction:

10

The Morph Sequence

For this section we used the Mid-Way face code, but adapted to take variable cross-dissolve and warp parameters, in order to animate the morph into a gif.

Output Gif:

8

The “Mean Face” of a Population

For this problem, I used the Danes dataset–more specifically, the neutral expression males subset. I also made use of Sean Farhat’s asf parser code. I had to add a point at each corner to try and preserve the overall composition of each image. One problem I ran into was the fact that the Danes dataset given points don’t include the hair or forehead in their composition. This means that while the faces themselves are beautifully aligned, the rest of the image/head is very much not well scaled/aligned, leading to some alien looking creatures. This could have been corrected by adding more points to the upper head area of each image.

Mean Triangulation:

9

Examples of Morphed Faces:

11 12 13

Final Averaged Face:

14

My Face Warped into the Average Geometry:

15

The Average Face Warped into my Geometry:

16

Caricatures: Extrapolating from the Mean

I used the smiling male subset of the Danes data set for this section. Here are a few examples at various levels of extrapolation. W=1 is the original image–anything above W=1 is a caricature of the original image.

W=1:

17

W=1.5:

18

W=2.0:

19

Bells and Whistles - Changing Sex and Smile

For the bells and whistles, I implemented the morph algorithm to morph myself into a smiling female. I computed the averages of the Danes dataset again (this time on the smiling females though) so that I could get unique, yet accurate results.

Smiling Female Average Image:

20

Smiling Female Triangulation:

21

50% Blend of Smiling Female Appearance and my Image on my Geometry:

22

Me on the Average Geometry:

23

Both of the Above:

24