CS194-26 Final Project: Fake Miniatures and Seam Carving



Amit Talreja - cs194-26-agt



Fake Miniatures

In this project we took pictures of a scene and tried to make it look like the objects were "toys" or miniature versions of the real things. This was accomplished by selecting an area of interest and then progressively adding more gaussian blur to the image as it moves away from the plane of interest. This simulates taking a picture with a small depth of field, which we associate with taking very close up pictures. In this way we "simulate" the view of smaller versions of the objects in the picture.


Where it worked well

The technique seems to work well for pictures that are taken from a high angle, as shown in the pictures of Hong Kong, traffic and some food that I made

Hong Kong Image courtesy of CNN


traffic courtesy of mindseyesolutions.com

Where it didn't work as well

In images where the camera looks up at the object or there isn't a lot of detail in the background the technique doesn't seem to work very well

traffic courtesy of mindseyesolutions.com



Seam Carving

For the second project I implemented the seam carving technique for resizing images, as described in a 2007 paper. The general idea is to use an "energy function" to ascribe an importance to every pixel in the image and then use a dynamic programming algorithm to find horizontal or vertical "seams" in the image to remove. Seams with the lowest overall energy theoretically contribute less to the semantic meaning of the image so they can theoretically be removed without greatly affecting the "importance" of the objects in the image.


Where it worked well

I used a sobel filter for the energy function and it looked like the technique seemed to work well for pictures that had clear differences between the foreground and the background.


Where it didn't work as well

Unfortunately the sobel filter did not seem to lead to good results for all images. For example, carving the same campanile image horizontally instead of vertically completely erased the campanile, where a person would probably keep the tower as the focus of a cropped image. Similarly, instead of erasing the sidewalk in the second image the algorithm removes part of the plant.


Reflections

I really liked these projects (and the class as a whole!) because it mostly involved applying simple mathematical techniques to illustrate how images get processed and how something like photoshop could work. I learned a lot and it was really cool to have graphical outputs for each of the projects because it lead to some cool visuals. Thanks course staff!