15-463: Project 3 - Seam Carving

original -50

Krystyna Genser 10.01.2012

Overview

The objective of the assigment is to resize an image in a 'smart' way, i.e. keep important information while removing uniteresting parts. While this does change the dimensions of the image, it does not change the resolution of the detail which remains! Instead of evenly subsampling or cropping the image to obtain the desired dimensions, one removes horizontical or vertical seams. The cost of removing a seam is determined with an 'energy function' and the least costly seams are removed from the image in order. In my particular case, I chose to use a gradient magnitude function as this identifies edges, which typically indicate important information we don't want to remove.

Initial Difficulties

At first, I noticed some issues with my beach image: it was eliminating seams within the starfish even though this is clearly undesirable! I realized that this was due to my enegery function resulting in incorrect cost values at the bottom and right edges of the image. I fixed this by assuming there was no cost to removing any pixel in these last row and choosing the minimum value from the second to last row instead.

original not working working

left to right: original image, seam carved image due to energy function noise, seam carved image after fix (50 seams removed both times)

image thanks to John White Photography

Successful Results

The following images are a variety of both horizontally and vertically (though not both) carved image that were succesful.

original -100 -200

left to right: original image, seam carved 100, seam carved 200

original not working

left to right: original image, seam carved 50

Image thanks to Transitioning

original -50 -100 -200

left to right: original image, seam carved 50, seam carved 100, seam carved 200

This image seems to lend itself particularly well to seamcarving because even at almost half the original width (-200 seams), the only visible artifacts is the sky near the right cliffs, and one doesn't even notice at first!

Image thanks to National Geographic

original -50 -100
original -50 -100

left to right: original image, seam carved 100, seam carved 200

Image thanks to National Geographic

original -100 -200

left to right: original image, seam carved 100, seam carved 200

Image thanks to Australian Geographic

original -50 -100 -200

left to right: original image, seam carved 100, original image, seam carved 100

I was concerned that these images would not resize very well, but alas, they did! what a pleseant surprise! I can now include pictures of kangaroos of various dimensions no problem on any website I desire.

Image thanks to Interesting Facts and the Guardian

Not so successful results

Unfortunely, most (if not all) algorithms have their limitations. The following are examples where seam carving is not the answer as it leaves undesirable tell-tale artifacts.

original not working

left to right: original image, seam carved 150

Due to the even nature of the sky in the image, seams are continued to be removed from the top of the image and destroying the bridge. Rather than from the water where the waves, though had softer edges were more comulatively than sky and bridge.

original not working

left to right: original image, seam carved 100

original not working

left to right: original image, seam carved 150

In this image, the shadows caused by the rocks interfere with eliminating the right seams. Instead of bringing the rocks together, it 'slims' the rocks, and in some cases almost eliminating entire formations.

Image thanks to this blog .