15-463 Project 3
Seam Carving
Kevin Ku
October 13, 2014
Overview
The goal of this project is to implement seam carving to shrink an image to a given dimension.
I chose the gradient of the grayscale image as the energy function. The advantage of this energy function is that it identifies edges around objects, thereby preventing a seam from cutting through an object.
Results
Images shown are resized to 75% of their original size equally along the x and y direction using my seam-carving algorithm.
Click on any image to see the original.
Yosemite 1
Source: http://yosemitesoftware.net/wp-content/uploads/2014/06/yosemite-national-park-glacier-point-half-dome-sunset.jpg
Yosemite 2
Source: http://www.lonelyplanet.com/travel-blog/tip-article/wordpress_uploads/2013/12/Yosemite.jpg
Starry Night
Source: http://www.wallmu.com/popular/wallstock/vincent-van-gogh-starry-night-fresh-new-hd-wallpaper.jpg
Ocean
Source: http://images6.alphacoders.com/335/335632.jpg
Surfer
Source: http://static.squarespace.com/static/5176fdb5e4b083b631f31303/51783e16e4b0c91d3145d24f/51783e50e4b0c91d3145e4c1/1366835281070/bigstock-Surfer-on-Perfect-Wave-in-the-17177108-e1342625710212.jpg
Baby
Source: http://www.indigopixies.com/wp-content/uploads/2013/06/HD-Baby-Wallpapers-1-1.jpg
Carving Artifacts
Some images created artifacts when seam-carving was applied. The root cause of the error lies in the energy function, as the energy function I chose requires objects to have distinct outlines. If this assumption is not met, then the seams will cut through the objects and create the artifacts.
Minions
Source: http://www.entertherift.fr/news/864.jpg
Bells and Whistles
Efficient Seam Carving
My algorithm pre-computes all the seams for an image using Python before shrinking the image in the given dimension. Therefore, once the pre-compute step is complete, resizing can be done very quickly.