Bradley C. Grimm
u0275665
snard6@gmail.com

Project 3

Morphing
Matlab Functions: morph.m calculate_rbf_weights.m interpolate_morph.m thin_plate_spline.m (display_parameters.m, load_params.m, mouse_pressed.m, track_positions.m)

Note: Many of the images are cropped by hand. I did this so I could show the images off to my friends and family (since it was their pictures I took).

Note: In order to add control points I added a point and click function to matlab, two of the above functions are related to that: mouse_pressed.m and track_positions.m

Q1)
The quality of the morph is highly related to the number of control points. The more points, as long as they are accurate, the better the registration. Interestingly enough I found that more points were needed than I might have expected, but still a reasonable amount. And it's also very important to focus on certain areas of the image. For instance I was doing the morph with faces. Originally I thought that a single point in each eye would be sufficient. I later found that it took at least 3 points to get the eyes to match up in a realistic way. I was also surprised at how important it was to match up girls hair, their hair required a fair bit more work than I expected.

A good example of bad control points is the following morph. This was a morph between my brother and me. A total of 38 control points were used to accurately describe the morph. Yet we notice artifacts along the ears. Even though we have more control points, our ears aren't adequately explained. We could add an arbitrary number more of control points, but unless we added one on the two edges of the ears, it wouldn't benefit us much.

Brad

Morph at 50% (Cropped manually)

Bryan


Note: I used bilinear interpolation for the images. I originally used a simple rounding scheme. When I finally switched to bilinear interpolation I noticed a huge leap in the amount of realism I got from the images.

This example can be found here: bradbryan.txt
Another I noticed from this one is that little items can cause bad artifacts in the warping process, like the hand. If the objects don't match up it gives an ugly ghosting effect.

Below are a few examples of faces. Each is morphed at 50%. The reason for this is I found 50% to be the wow level. Where the new person looked most like a new person, showed attributes of the previous images. I've also included the squares example given to us.

Note: I noticed that the squares example that was given to us had one incorrect point on the edge of the square. It caused a bunch of frustrating thinking my algorithm wasn't working at first. I later decided to use the atlas point for those two squares to do my morphing as they were correct. I added some code to the morph so that it morphs all of the images in a parameters file together. This later allowed me to create some fun images from my atlas set.








The above parameter files are: brycarrey.txt sarahjulia.txt sarah2ashley_2.txt

Q2)
The radial basis function is extremely crucial. In fact I found the parameters of the Gaussian to be extremely important. If the standard deviation was too small, you get lots of little warpy circles. If the standard deviation is too big you don't get enough distortion. It wasn't always clear what the value should be and generally took a few passes in order to get it right. The thin plate splines performed much better, and always gave a reasonable amount of bending.

Standard Deviation of 10

Standard Deviation of 20

Standard Deviation of 40

Standard Deviation of 80



Note: For all of my family pictures I went with the thin plate splines because it required one less parameter to modify, while giving suprub results.

Atlas
Matlab Function: atlas.m

Q3)
For the brain I decided to take a negative/positive space approach. Many of the brains seemed to have voids and holes, and I did my best to mark those as definite land marks. I also started marking what I called “arms” though I'm not sure if this was such a good idea as it was really hard to determine what should (and shouldn't be considered an arm). I also added points along the perimeter to help keep the shape, as I noticed from the faces that not doing this could give fairly disproportioned heads. Here is my brain atlas:


We can see the points I used for this specific case. We can see fairly quickly that there are some regions that perhaps aren't performing very well. The skull seems to split at the top, which isn't shown in any of the individual images, so perhaps more control points are needed. Obviously with only 15 control points we can only expect so good of an atlas.

Below is the shapes example:

This one I think shows a bad example more than anything else. The morphing between shapes isn't very good, and many of the control points are off significantly. As a result the final atlas is less than impressive.

Below is example of the atlas with faces. I didn't expect very good results since I used a fair bit of variation in my choices, but I was impressed with the results.

Note: I didn't include all of the atlas images. I used 20 images to generate the below image and I didn't want to bloat the report too much. The 20 images were of friends and family. Some faces had a little more real estate than others (for instance my brother had 4 images, and my wife had 3). But most people just had a single face.

I was really surprised with the realism of the atlas. In some regards it looks like an artist representation of a brother I never had (kind of creepy too)!!

Q4)
The accuracy of the control points is extremely. While working on the atlas I moved a fair bit quicker through placing the control points than I did on the above morphs. I later when in and used my atlas parameters to do individual morphs on faces. The results were less impressive than the above morphed images. where I put more time into them. I also had to use more generic points for the images. Where the images were already similar the result was decent, but where the images were vastly different the results came out much worse. For instance the control points didn't include hair points (since the guys all had short hair). The result is that the hair in the below images is much less believable than the above images. Surprisingly the atlas result still came out looking really good.

Note: The above images all have the same left image, but three different right images were use to generate the 50% morph. Notice how the faces are fairly good, but because 20 faces were used control pointsdidn't include long hair, bodies, or the glasses (which are the 3 things that look really bad about the images).