CS 176 Project 1: Seam Carving for Content-Aware Image Resizing

Introduction

Seam carving is an algorithm used to dynamically resizing images while preserving features. The algorithm works by removing seams of high "energy" from images. The project site for the original paper and the improved algorithm give more details about the algorithm.

Running the Program

You can download the source here. You can download a Linux binary here. To run the program, just give it the filename of the PNG to perform the algorithm on. Controls are as follows:
  • '[', ']' - Decrease/increase the image width by 10 pixels
  • 's' - Switch between simple scaling and seam carving
  • 'e' - Switch to seam-carving, and toggle between forward and backward energies
  • Escape or 'q' - quits the program

Results

Examples of the program are given here. All of the examples are given in the following order: Original, shrunken forward, backward, and scaled, enlarged forward, backward, and scaled.


Discussion

The forward energy yields much better results with the arch. Notice that the figure in the column is preserved in size, and the overall shape of the column is better preserved with forward energy. The backward-energy versions removes low-energy sections too aggressively, messing up the side of the column.

Unsurprisingly, both methods fail when the focus of the image is of low energy itself, such as the heart in the third image set.