Project 3 - Seam Carving

by Andrew Tan

15-463: Computational Photography

Project Details

The goal of this assignment was to perform content-aware resizing by seam carving

Approach

To perform comtent aware resizing, I determined the 'importance' of each pixel through an energy function and then calculated the 'least important' seam (through DP). By removing this seam, I shrank the image in one direction. To calculate the 'importance' of each pixel, I created a number of energy functions. They all performed well on different types of images. I used the image's gradient, created a [-1 0 1] filter to determine dx/dy (without a shift) as well as a sobel filter. When using these filters that capture the differences in one direction only, we need to convolve it both vertically and horizontally accross the image (so I transposed the filter and ran it twice). And to combine the two directions as well as the different color channels, I tried both using the square magnitude as well as the absolute value. Both seemed to work fine.

Results

Vertical Resizing

source

The Moon and Venus in the night sky get brough much closer to earth and each other when many unimportant seams are removed (extra sky and ground). More could be removed but I stopped as is because it looked nicer.

source

A picture of the sun in antartica. Here the least important parts of the image happened to be the sky. If more seams are removed, the snow would be the next to go.

source

Itsy-bitsy sidewalk. The sidewalk is the least interesting part of the picture and therefore gets shrunk. Now it's just a litte sliver of a sidewalk.'

source

The Scream by Edvard Munch

Horizontal Resizing


source

Because of Ronald McDonald's very flat uniform, the uniform shrinks before his face, and thereby creates an illusionof a shrunken body

A super famous picture by photographer, Charles O'Rear

source

I liked this one because in the carved image, the volleyball player is going to end up missing the ball because of the ball's change in position

source

All the boats come to dock

source

Thinner buildings in Tunisia

Bad Results

source

This didn't work for a number of reasons. Suprisingly, the faces stayed more or less correct, but did show some warping. However, because it's a magazine cover with blocked text, the text blocks became too close together and then eventually began to become the least interesting spaces. Once the text became part of the least interesting seams, they began disappearing. Additionally, since the body needs to be protected somehow, without protection, the body dissapears and results in bad proportions.'