Project2 - Seam Carving

Pinar Ozlen

 

The pixels to be added ot to be removed (seam) were chosen according to an energy function applied to the image. Afterwards a cost table was constructed on the 'energy image' in order to find the pixels with least energy. (It's desirable for areas with less content/detail to have low energies.) By dynammic programming, a seam was constructed from this cost table and added/removed from the image. I implemented the implementation in 2 stages. The first stage -precomputation- finds which seams are to be removed and stores the seams in an array. In the second stage I actually remove the seams from the image.

 

Seam Removal on Nick Brandt Images:

 

Seam Removal on Andreas Gursky Images:

 

Seam Addition On Ando Hiroshige's Images:

 

The performance of the seam carving algorithm depends higly on the energy function being used. I tried out several different algorithms and the one that seemed to work better were gradient energy over a grayscale image and applying sobel edge filters on 3 color channels. Thus, I compared these two energy functions on different images.

 

Comparison:

In this image, the gradient energy computation seems to be doing better. This might be due to the more detailed edge detection of the sobel edge filter and the intensity of the brush strokes. (First row is gradient energy, second row is sobel detection)

 

 

Failure:

The image where both algorithms failed was an image by Gursky, that depended heavily on continuity of winding roads. The first row is using the sobel edge and the third and last row is gradient calculation. Although neither functions did a good job in the result, due to more accurate edge detection with the sobel filter, the sobel energy function seems to be doing slightly better.