In this project we look to create morphs. Morphs are essentially a combination of a shape / geometric warp and a cross dissolve of colors. The color warp is rather simple as a cross dissolve of the colors of the two images. In order to implement the geometric warp, it was necessary to define correspondences for each image. I found this to be a rather tedious process as the points needed to be defined accurately in order to produce good results. The points would then be used to compute triangulations as seen below.
After defining the correspondences on each image, in order to compute the midway face between the two images, we needed to average each of the points that were chosen. Where
avg_pt = .5 * pt1 + .5 * pt2. We then used these average points in order to compute a triangulation that would allow us to correlate image patches. This would allow us to map each triangle in the source image to the triangle in the mean image. By doing so, we would be able to find the mean image or midway face. For each triangle, we compute the affine transformation that will transform the source triangle into the target triangle. After finding the affine transformation, we take the inverse and use the inverse transformation in order to find the source pixel that we should take for each target pixel. The average color is found by simply averaging the pixel values of the source and target image.
The morph sequence is very similar to the procedure for finding the midway face as detailed above. The only difference is that we will adjust a
dissolve_frac that will determine the weights or the amount that we take from each image (either source and target) while that we are warping / dissolving. These weights will slowly increment or decrement from frame to frame.
The mean face of a population is calculated by aggregating the points of each image in the dataset and finding the average. This is done both for the correspondences as well as the pixel values of each image. All of the images will be warped to the average image and then an average will be taken of them as described above. I chose to use a subset of the population consisting of women who were smiling and showing teeth in their smile. I did this in order to generate the best looking average face of the population.
In order to produce the below cariacture of my face from the population mean calculated above, I simply found the difference between my points and the population mean points and added that back to my points. This allowed me to enhance certain distinguishing features.
I chose to morph my face into that of another gender's. In the example below I morph my face into that of the average Chinese male's.