This project attempted to use image morphing to morph different people's faces into each other.
To do the morphing, I first computed the triangulation of the points on my face. Then I used the morph fraction to calculate the control points that were that fraction between the existing control points. Once I had that, I could use the triangulation to calculate the affine transform between each of the triangles.
Once I had the triangles, I needed to figure out which triangle each new point was inside and get its value by cross-dissolving the values from the original points. I used the mytsearch function to figure out which triangle contained each point in the image. If a point was outside a triangle, I assumed the point was in the same location in both images and just did the cross-dissolve.
I performed this process for 60 equal increments between 0 and 1 to create 61 separate frames. Then I used ImageMagick to assemble an animated gif from these frames.
In order to find the mean face, I simply used this algorithm repeatedly to morph in each new face. I then also tried performing a morph between my face and the average face.
The person whose face I morphed my face into (Joman) had his face oriented completely differently than mine, so the resulting image came out looking somewhat weird. A lot of the morphing was moving the locations of features rather than actually morphing the features themselves. If I had used a face which was more similar to mine and had similar orientation I might have had an easier time.
One interesting artifact I noticed from morphing into the average face is also an effect of the differences in orientation: there seemed to be a blurred area where my right ear would have been. Since there was no information to put there, it was simply stretched out into a single blurry region.
One thing I attempted to do was add control points on the edges in order to make the backgrounds morph appropriately as well. This was not nearly as important as morphing the faces themselves, but it made sure that points near the edges of my faces were within triangles and did not have jagged edges.