Project DescriptionSuccess CasesFailure Cases
Project Description

Image Resizing by Seam Carving

Shai Avidan and Ariel Shamir have invented a novel way of resizing an image that aims to preserve important elements. Their method, called seam carving, can reduces an image by removing low energy seams (connected paths of pixels spanning from one end of the image to the other). Similarly, inserting new seams along low energy paths can be used to enlarge an image.
For this project, I wrote an implementation of the seam carving algorithm in Matlab that can either enlarge or reduce an image. I use gradient magnitude as the energy function to minimize. Some of my results follow, with the original image on the left, for reference.
Success Cases

Reducing Images

Enlarging Images

Failure Cases
One problem with seam carving is that some important elements of the original photo may not be preserved. Small or thin objects may be warped substantially, as will perspective lines. Attempting to resize people usually looks bad as well. Deleting or adding too many seams tends to exaggerate these artifacts. Here were some images I resized that proved to be poor candidates for seam carving.