Aarav Patel
Project 3 is an exploration of the following: 1) defining good points of correspondence between two faces (based on primary features like eyes, nose, mouth, etc.), 2) computing facial geometries (Delaunay triangulation), 3) warping faces into different geometries, 4) creating smooth morph seqeunces, 5) computing the mean face of a population, and 6) extrapolating from the mean face of a population to create caricatures.
I decided to morph my little brother's (Ayan) face into my (Aarav) face. I first had to label points in both images to define the correspondence.
I then averaged the defined points in both images to arrive at a mean correspondence. I subsequently used Delaunay triangulation to define the mean geometry.
I first wrote the computeAffine function to generate the affine transformation matrix that maps the target geometry (in this case, the mean geometry) to the source geometry. Then, for each of the input images (Ayan and Aarav), I warped its geometry to the mean geometry. I achieved this using the following method: 1) I created a polygon mask for each of the triangles in the mean geometry, 2) I computed the affine transformation matrix to map the triangles from the mean geometry to the source geometry, 3) I applied this transformation to sample from the corresponding location in the source image, 4) I cast the coordinates to integers as this yielded efficient and sufficient results (and was approved by course staff on EdDiscussion). After generating images of Ayan and Aarav with the mean geometry, I averaged them to get the mid-way image.
Here, I generated a .gif of a morph sequence with 90 frames at 30 fps. Each frame is a differently weighted average, starting with the original image of Ayan and ending with the original image of Aarav. The .gif cannot be viewed on page.pdf–– please use the site to view it.
For this part, I choose to use the IMM Face Database ("Dane dataset"). I first parsed all the .asf files and computed the average correspondence for males, females, and both together. I then computed the average geometry for each of these groups. I then warped all the males to the average male Dane shape, all the females to the average female Dane shape, and finally the entire dataset into the average Dane shape. Note that there were far more male samples in the dataset, thus the average shape for the dataset skews towards the average male Dane shape.
I then averaged all the results from each group to arrive at the average male Dane face, average female Dane face, and average Dane face (which skews towards the average male Dane face due to dataset imbalance).
I then warped my face into the average Dane face and vice versa.
To create caricatures by extrapolating from the average Dane face, I set the warp_frac parameter of morph to 1.5 (exaggerate the average Dane's features) and -1.5 (exaggerate my features).
For this part, I choose to change my ethnicity to Chinese. I used the web to find an image of the average Chinese Male's face.