Programming Project #2
15-463: Computational Photography

Assignment

The assignment results are ok. The image warping movie came out with some ghosting that I was not able to remove completely. Initially, the eyes were not lining up properly, but once this was corrected, the ears stopped lining up. This may have been a problem with the interpolation of points. The mean faces, on the other hand, were quite horrible; there seemed to be some issues with lining up the faces with the correlation points. I unfortunately did not have time to fix these one-by-one.

The program consists of two main files, with two additional helper functions

  • warp_zmouri(imageName1, imageName2) - the warp function, this takes in the names of two images, reads in the correspondence points from files "input_points.txt" and "base_points.txt," writes each frame to a file, and returns a matrix with all of the images
  • mean_face(img, pts) - the mean_face function, this takes in a 4-dimensional matrix of a set of images, and a 3-dimensional matrix for a set of correspondence points for each image, calculates the mean face, and returns it, along with the results of my face warped to the mean geometry
  • morph(im1, im2, im1_pts, im2_pts, tri, warp_frac, dissolve_frac) - the morph helper function, this takes two images, the correspondence points, the delaunay triangulation, and warp/dissolve parameters, and returns the morphed image
  • computeAffine(tri1_pts, tri2_pts) - the affine helper function, this takes in two matrices of triangle points, and returns an affine transformation matrix from the first to the second
To execute the programs, run warp_zmouri with the names of the images, and mean_face with the sets of images and points. For example,

EDU>> m = warp_zmouri('Zach Mouri-scaled.jpg', 'Chris Marshall-scaled.jpg');
EDU>> movie2avi(m, 'warp.avi');
				

Note that the points for the warped images must be saved in the current directory as "input_points.txt" and "base_points.txt"

Warp Results

The following AVI was created in MATLAB and is the result of the image warp. Click to download (230 KB)

In addition, this directory contains the initial and scaled images, the set of correlation points, and each intermediate morph.

Mean Face Results

The following images are the results of calculating the mean face:

The mean face

My face warped to the mean face geometry

The mean face warped to my geometry