Today, we will be investigating morphing, transforming one image into another. All morphs boil down to warping and cross-dissolving images, tools which let us compute and output a morph. In this project, we will be defining correspondences, computing the midway face, showing a morph sequence, calculating the "mean-face" of a population, creating caricatures, and changing features of images.
In this part, we define a set of corresponding points between the two images. The keypoints picked usually correspond to significant features on the face, and I picked them using my own function, which used the ginput tool. Then, I calculated the midway face, the average of the two faces, and then ran Delaunay Triangulation on them. Images with both the points and the triangulation set on the two images are below.
Now we reach probably one of the most important parts of the project, the computation of the midway face. Using the average shape and after computing the inverse of the transformation matrix between each triangle in the original image with the corresponding triangle in the average shape, we are able to warp the image, using a polygon mask. We then cross-dissolve to get the midway face.
Now that we can warp to the mid-way shape, we can create a morph sequence that shows a nice morphing between the two images below. (Reload the page to see the gif if you want to see the gif again)
Now, we are going to be calculating the mean face of a population. We will be looking at a data set (IMM database) of the Danish population, specifically the 37 images from the initial dataset. This set consisted of 30 males and 7 females, and the mean face was computed after reading in the asf and bmp files in the dataset. The asf files contained the necessary keypoints needed to help with the computation of the mean face of the population. Below, are a few of the images warped to the mean face. I then warped my face to the mean face and then warped the mean face to my face.
Here we will be working with caricatures, which is an exaggeration of features, which we will be doing by warping faces to an exaggerated version of the average face shape. I did this process to both my face and an image from the IMM database.
I decided to try an ethnicity change on my face using an "average" caucasian male face. There were methods explored: only morphing shape (warping), only morphing appearance (cross-dissolving), and morphing both of them.