Eilam Levitov - cs194-26-acx
This notebook runs on python 2.7
In this assignment we play with the affine transformation, morphing
faces and making caricatures.
Morphing
is done by: (1) Aligning, and (2) Cross-disolve.
(1) To align we apply an affine transformation on the source traingle to adjust it's shape to the target traignle. Our affine transformation can be described as 3 basic transformation which stretch, rotate and translate. Our resultant transfomation, represented as a (change of basis) matrix is as such:
$$T_{affine} = \left[ {\begin{array}{cc} a & b & c\\ d & e & f\\ 0 & 0 & 1\\ \end{array} } \right] $$(2) Here we simply add the image's color such that it sums to 1
Additionally, in order to create a smooth morphing transition, we will generate a sequence with progressing adjustment
value by shifting the triangulation points to one side rather than the other. The adjustment
value is effectively the importance of each image with respect to our transfomation.
Finally, we will further explore the face morphing domain, averaging groups of people and pin-pointing facial features, specifically smiling :)
Follow the notebook for more specific details on the process of this project!
# 1. Load images
# 2. Load (manually) pre-selected points
# Display
# 1. Calculate Mid-way Face points
# 2. Triangulate Mid-way Face points using Delaunay Triangulation (maximize smallest angle)
# Display images with Mid-way Face points
# 3. Morph original images to Mid-way Face
# Display morphed images
# 4. Combine colors to generate Mid-way Face
# Display
# 1. Morph images with progressing ratios
# Display (Selected) Progressions
# Saved images and generated .gif via photoshop (anaconda paths ftw...)
# 1. Load images; Display example
# 2. Load points and take average; Display example
# 3. Triangulate Mid-way Face points; Display example
# 3. Morph images to average, and combine colors
# Display
# 1. Load images; Display
# 2. Load pre-selected points
# 3. Calculate Mid-way Face points
# Display
# 4. Triangulate Mid-way Face points using Delaunay Triangulation (maximize smallest angle)
# Display Mid-way Face points on each image
# 5. Morph original images to Mid-way Face
# Display
# Display 1
# Display 2
# Display 3