Project 5 Writeup: Face Morphing
Basia Korel (bkorel)
March 26, 2010

Project Details and Implementation
 
This project entailed implementing an algorithm to interpolate or morph two images together, in particular using face images as the data. The simplest approach to morph two images together is to take equal weights from both images and cross dissolve without alignment using 0.5*imgA + 0.5*imgB. The results are displayed below.
 

Image A

Cross-Dissolve without Alignment

Image B

   
 
Instead it would be better to perform a local warp such that the faces are better aligned. This is achieved through the use of correspondence points which the user selects. Based on these correspondence points, point one in image A should map to point one in image B. Below are the correspondence points used for two faces.

 
 
For each pair of correspondence points, an intermediate point is calculated based on a warp ratio value from 0 to 1; these intermediate points determine the shape of the warp. Next the offsets between the correspondence points in image A to the intermediate points are calculated, as well as from image B to the intermediate points. The offsets indicate where in each source image we should obtain the pixel value used for blending. Offsets for every pixel index must also be calculated before the images can be blended, and thus the Poisson blending code is used from project 2. A system of linear equations is solved using Ax=b with the known offsets as the constraints and the unmarked pixels as the unknowns being solved for. A change was made in the project 2 code such that for every unknown pixel the value 0 was placed in the b column vector; every unknown pixel is the average of its four neighbors. Finally the images are blended together by taking pixel values at the offset locations from each image; since the corresponding location of the offset may be "between" pixels, the nearest neighbor pixel is selected. The weighting of the pixel values from each image is based on a cross dissolve value from 0 to 1.
 
 
Face Morph Animation 
 
 
 
Mean Face
 
Below is the mean face calculated using the entire class dataset.

 


 
Results
 
Below are image results of face morphing; the a values is both the warp ratio and the cross dissolve value.
 

Image A

a = 0.25

a = 0.5

a = 0.75

Image B