CS180 Project 3

Artem Shumay

Project tasks:

1 Define correspondences.

2 Compute mid way face between two people.

3 Morph one face onto another.

4 Find average face of a population.

5 Create face caricatures.

6 Change certain feature of a face(gender, ethnicity).

Part 1: Defining correspondences:

I used the provided website to mark correspondence points of notable features on faces. I then averaged the points of two faces and ran Delaunay triangulation on that to segment image into triangles. Here are my results:


Part 2: Midway face

To go from pixels on original image to pixels on the final image we need to find an affine transformation. An affine transformation is defined as follows:

It can be solved with 3 points. So we can find a solution per triangle created from correspondence points. To morph an image: create a new image with the size of old image and call it our canvas, now per triangle in correspondence set find a corresponding triangle on the canvas by doing p'=fac*p1 + (1-fac)*p2, where p1 and p2 are points on triangle from image 1 and 2 and fac is morph factor, 1/2 for midway face. After calculating the new points, find a transformation between this new triangle and corresponding triangles from images, for pixels bounded by triangle on the canvas apply transforms to go to the original image spaces and grab the value multiplied by dissolve_frac or 1-dissolve_frac, 1/2 for midway face. If upon conversion from canvas space to image space pixels do not land directly on the pixels, I interpolate between them to get smooth results.



Part 2.1: Morphing

Instead of calculating midway face with warp factor of 1/2 and dissolve factor of 1/2 we can change those factors and get a weighted average. Now we can let those factors go from 0 to 1 over time to get transformation from me to george:

Part 4: Population's mean face:

To calculate the mean of the population, I averaged correspondence points of all people in the set and then warped original faces to the average points averaged(morphed) them together, I got the following result:

First two faces originals and warped to average face shape:

Me warped to average and average warped to me:

Caricatures:

An interesting observation is that I start smiling more with higher factor, this is because the average picture smiles, and I do not, so the difference gets added over and over again adding a smile. Another noticable difference is that my eyes start looking more outwards.

Bells and whistles: Ethnicity and Gender change.

To change the characteristics I used two approaches. First one, I took the differences in shape between average male ukranian person and average female ukranian person. I then subtracted that difference to me to get the new shape, the shape itself was not enough, so I also subtracted average male pixels and added average female pixels to me to get greater effect:

I think it worked relatively well. Although the original average images do look similar, in the final picture you can definetely see that my eyes got bigger and had some eyeliner added to them.

The other method I used is to just blend my face with the average face. I used warp factor of 0.8 and cross-dissolve factor of 0.25. Here are the results:

The results are not the best, but I have tried it sevreal times with different alignments and different blend factors, and this is the usual result I got, my face got wider. You do see the differences and it does what it is supposed to do, I think a better effect could be achieved with manual tweaking further.