I began by cropping and rescaling the images of myself and LeBron so that they would have identical dimensions. I then proceeded to use an online tool to choose a collection of points (31) that matched so that I could produce the warping shapes. This included the four corners of each image. I then took the mean of corresponding points and computed Delaunay triangulation using SciPy.
The next step for me was to compute the midway image between myself and LeBron. To do this, I began by computing the average shape using the triangulation points corresponding to each other from each image and averaging them. After taking the Delaunay triangulation of this, I calculated the inverse of the affine transformation matrix between the original triangle in each image and the corresponding triangle in this average shape. I used polygon to then obtain all the pixels in each triangle and do interpolation using RegularGridInterpolator (Scipy). I also cross-dissolved the warped images, taking half of each and adding (for each pixel) to obtain this midway image.
I applied what I did in part 2, now instead of using strictly .5 as the warping/dissolving constant I used a range of values between 0 and 1. I used exactly 45 values, inclusive of 0 and 1 (np.linspace helped here). I then created a GIF file which shows the morphing from myself to LeBron.
For this part, I used the FEI face database. In particular, I used the A images (100). I parsed through each of the text files for points to obtain corresponding keypoints for each image and averaged to get the average shape. I then morphed a few of the images into this shape (selection shown below). I also morphed all the images into this shape and took the average to obtain the average face. Finally, I morphed my own face into this average shape, and taking the geometry of my own face, morphed the average face from the dataset into mine.
Here I used alpha values of -1 and 2 to exaggerate both my features and the population's features, using my face (where 0 is my shape and 1 is the population average shape).
Here I morphed myself onto the average Chinese male face taken from here. I created images for just dissolving, warping, and both (all t = .5).
Here I once again morphed myself onto the Chinese male face. However, this time I used cv2 to implement gradient blending. I used Sobel to differentiate the images and blended together the gradients, creating a total of 30 frames for a GIF below.
Here I morphed together a few different popular NBA players, mostly from the Los Angeles Lakers. I added 'All of the Lights' by Kanye West and others to form a music video, inspired from the video game 'NBA 2K14'. Enjoy! Link
This time I chose to try pixelation instead for morphing two images (Bronny and LeBron). Results are below.