CS 194 Final Project: Miniatures and Seam Carving

Michelle Ling

cs194-26-abk

Fake Miniatures

In this project, we attempt to create fake miniatures by simulating selective focus cameras. The method that is implemented is called tilt shift where the camera moves to 1. tilt the orientation of the plane of focus or the area that looks sharp on an image and 2. shift the position of the image area without moving the camera back. This is accomplished through first masking a user-selected focus plane and then applying a gaussian, blurring filter to the image. What this aims to do is to make the image seem like it was taken with the camera lens very close to the subjects in the picture. This will trick the eyes into thinking that the objects are miniature. After the user selects an area for the region of sharpness, everything afterwards becomes increasingly blurry as it moves away from this region of sharpness. I created a Gaussian stack of the image as well as a mask with the user-defined region. The final step of this was to increase the saturation of the colors within the image. Generally, doing so will make the images appear more "miniature" and "toy-like." Results are below.

Train Station
Original picture
Miniature picture
San Francisco Road
Original picture
Miniature picture
Original Boats
Original picture
Miniature picture

Below are some pictures that I took on my own from an apartment building roof as well as at Navy Pier on the Ferris Wheel.

Berkeley Apartments
Original picture
Miniature picture
Navy Pier
Original picture
Miniature picture
Original picture
Miniature picture

My personal favorite was this picture of Memorial Glade.

San Francisco Road
Original picture
Miniature picture

Overall, I really enjoyed this project as it takes relatively simple effects and creates some very interesting images. I found that the effectiveness of my overall results really varied with the picture that was taken. Some photographs just don't seem to be quite as "miniaturizable" as others. Selecting the focus point of sharpness also makes a big difference on the final result.

Seam Carving

The purpose of this project was to implement seam carviing as a method for content-aware image resizing. In order to so, one must compute an optimal seam to remove pixels from the image to downsize it. Each pixel will have an energy function, I used a gradient energy function in this case, and this will help us choose the path with the least total energy. I implemented dynamic programming to compute this path. The image can be resized either horizontally or vertically. The image just needs to be transposed in order to resize horizontally.

Results
House
Original picture
Resized picture by 25% horizontally
Boats
Original picture
Resized picture by 30% vertically

As the water is relatively uniform, most of those pixels were removed in the seam carving process.

Corgis
Original picture
Resized picture by 20% vertically
The Met in NYC
Original picture
Resized picture by 40% horizontally
Trees
Original picture
Resized picture by 30% horizontally
Beach
Original picture
Resized picture to 250 x 250
Failures
Harry Potter
Original picture
Resized picture by 40% vertically

Poor Hermoine's face got ruined in this seam carving

Bridge
Original picture
Resized picture by 30% horizontally

The farther portion of the bridge unfortunately got warped in this process

Snowman
Original picture
Resized picture by 30% horizontally

As the snowman was uniformly white for the most part, it ended up getting carved out.

Memorial Glade
Original picture
Resized picture by 25%

The glade got a lot smaller in this case and is now pretty unrecognizable in shape.

Overall, I enjoyed this project as well. It was definitely interesting to see what ended up being carved out of the picture and it definitely made a big difference what the actual image was. This project taught me a lot about how can we can manipulate the pixels in an image. The results that were successful impressed me with how much they looked like actual pictures that could have been taken.