CS194-26: Image Manipulation and Computational Photography, Fall 2017

Project 4: Face Morphing

Yanhe Chen

Part1:Defining Correspondences

define pairs of corresponding points on the two images by hand (the more points, the better the morph, generally). The simplest way is probably to use the cpselect (matlab) tool or write your own little tool using ginput (matlab or python) and plot commands (with hold on and hold off ). In order for the morph to work you will need a consistent labeling of the two faces. So label your faces A and B in a consistent manner using the same ordering of keypoints in the two faces.

provide a triangulation of these points that will be used for morphing using Delaunay triangulation

Part2: Computing the "Mid-way Face"

1. Compute the weighted average shape for some given weight t that ranges between [0, 1] using the equation average_shape = t * image_A_points[i] + (1 - t) * image_B_points[i]

2.Given the points for Image A, Image B, and the Average Shape, we use Delauney Triangulation to obtain a set of triangles for the corresponding points and calculate the inverse affine matrices for each triangle.Specifically, computing the affine transform from the target (in the average shape) back to the source image. This was done for each triangle in image A, and then for every triangle in image B. I then warped all the triangles from image A and B to the triangles in the Average Shape to obtain a warped image.

3.The last step was to cross-dissolve the colors by finding the weighted color averages of Image A and Image B: mid_way_face[x, y] = t * image_A[xA, yA] + (1 - t) * image_B[xB, yB] for each (x, y) pair in the Average Shape and the corresponding mapped pairs found from step 2.

Part3:The Morph Sequence

morph(im1, im2, im1_pts, im2_pts, tri, warp_frac, dissolve_frac)

See that in youtube: https://youtu.be/qXHsLXDK-kg

part4 The mean face

1.Compute the average face of the population and display it.

2. your face warped into the average geometry, and

3. the average face warped into your geometry.

Caricatures

Thanks