CS194-26 Project 3:Morphing

Algorithms

The first key algorithm was defining an affine transformation. To do this I treated 2 edges of the initial triangle as basis vectors and computed the inverse to find a transformation to the standard basis. Then, I took the standard basis and used the other triangle as the transformation from the standard basis. Multiplying these two transformations produces the desired transformation after accounting for shifts.

Secondly, we computed a shape transformation, specifically a mid-way transformation between two images. This algorithm involved using inverse warping between predefined corresponding triangles of the two images. For each trial in the second image, we took the color value from the corresponding inverse point. For inbetween points, we used bivariate splining to approximate the color value. This allowed us to warp between the corresponding shapes from the first to the second.

The last main algorithm was actually producing a morph between images. This used a combination of many weighted shape averages and weighted color averages for each frame of the morph. The image was transformed to the weighted shape average using the earlier algorithm.

An additional algorithm included computing facial averages. This involved scaling and averaging the pre-defined feature points of the data set. From this average face we could use earlier algorithms to produce caricatures as well as change facial expressions and other things.

Images

Picture of George

Picture of Obama

Midway face of Obama

Midway face of George

Morph between George and Obama. Midway the morph has issues because of poor alignment of pictures and not enough correspondance points.

Example of a face made to be more average

Example of a face made to be more average

Example of a face made to be more average

Example of a face made to be more average

Example of a face made to be more average

Average face of Dane photo set

Photo of Danny Devito

Photo of Danny Devito made more average. While distorted, you can tell he has a smaller face (more average sized)

In comparison, the caricatured version of his face is more exaggerated and larger.

Average korean female smiling since I couldn't find Korean male.

My friend Jay who is not smiling

Jay with a shape morph applied to make him smile.

Jay with both an appearance morph, while not smiling has browner hair.

Jay with both shape and appearance morph.

bonus morph with more difficult shape transformation

original image

original image

Improvement

Some improvements that could be made would be better defining corresponding points for smoother morphs. Images could also be aligned better and have uniform background in order for optimal effect.