|christopher choyce -- firstname.lastname@example.org|
|about deformations blending resizing animation 200x200 400x400 download source|
The goal of P4 was to create an image morph from 2 basic photos; 1 from someone famous, and 1 from myself. People used to tell me I looked like Moby (I don't really think I do, at least not without a completly bald head). So I figured I'd take this opportunity to either prove or disprove everyone.
Finding a usable photo of Moby took a little bit of time, but I finally was able to find the one to the left. I figured if I was going to morph into Moby, I mine as well dress the part (pictured on the far right). All it took was a little "Photoshop Magic" and we were set to start the deformation process.
The first and third images are what I used as my base to create the animation. I took those 2 images and made 6 key frames out of them, following the flow pattern outlined below.
To create the Deformations of each photo, I used the turbo morph applet (provided by Professor Jarek Rossignac). I then modified the save/load routines to both output the points into a file format, and to output the current screen render as a JPG image. Also, I decided I would need a consistant facial map to use when creating each keyframe (that way I always had the same number of points, in the same order, making my interpolation step trivial). By lining up these map-points between key facial features in each of the images, I was able to create my key-frames.
I ended up keeping this as a manual iteration because the timing between to smoothing call and the saving routine would get off, so sometimes the smoothing wouldn't finish before the save was called --not good! I would like to go back and automate this so you could just start the process with your keyframes defined, and it would do all the iteration for you while you sat back, ate some popcorn and watched Veronica Mars.
In order to get the middle part of the animation working correctly, I had to blend together the image of Moby with the image of myself. I combined both a the interpolation method above, and an alpha cross-fade between the two images. I choose a function which ramped up quickly and then slowed down as it came to an end (basically the same function we used in P1a: F3).
What I tired to do was map the the moby photo's facial points to about where my facial points were for the moby-choyce blend, and then map my facial points to Moby's for the choyce-moby blend. While this worked, I noticed afterwards: I should have paid more attention to the glasses. His are significantly larger than mine in this photo, and when I mapped the eyes and ears together, I messed up the glasses mapping. His glass get bigger when they should get smaller but, time permitting, I would like to fix this.
Once I had all these images create, I had to resize them all to get a useable images. Rather then running the interpolation and blending over and over each time I wanted a different size animation, I just simple created a simple tool in processing to resize them to any width I would need. This resize process also removed the moby-choyce images and choyce-moby images (which are now combined into a blend) and re-numbered them to make the animation easier.
Click to toggle resize code display.
Then came time to animate it all. I could have just imported all of my animation files into Adobe Premiere, but in the spirt of Processing (and because I didn't have access to it at the time) I simply created an applet which loaded up all the files and then played the animation in a loop. This ended up working out nicely since I did a reverse loop so that the animation just cycles back and forth like a pendulum.
Click to toggle animation code display.
Download Source Code:
Here is all the source code I used to generate these images: