Project 3

Seam Carving
Evan Shimizu (eshimizu)

Summary

Gradient Magnitude Energy Function

This project crops images using seam carving, detailed in this paper.

I implemented seam carving using a basic dynamic programming approach. Given an energy function, the program looks at each pixel starting at the top, selects the pixel with the lowest total energy from the above three pixels and stores the sum of the total energy and the current energy value at the pixel's location. The seams are determined by starting at the bottom and finding the pixel with the lowest total energy and tracing the path to that pixel back up to the top. The energy function I used was the gradient magnitude, calculated with MATLAB's imgradient function.

Results

Dragon Spotting

1155 x 723 -> 800 x 600
Source

Original
Cropped

The Secret Sea Dragon

1000 x 624 -> 900 x 600
Source

Original
Cropped

Untitled

800 x 400 -> 300 x 300
Source

Original
Cropped

Space

708 x 570 -> 500 x 400
Source

Original
Cropped

Nesting Grounds

Original was scaled from 5100 x 3300. 2000 x 1294 -> 1500 x 1100
Source

Original
Cropped

Bridge

1920 x 1200 -> 1000 x 720
Source

Original
Cropped

Tree

Original scaled from 1920 x 1080. 1200 x 750 -> 1000 x 600
Source

Original
Cropped

Fortress Draconnis

720 x 500 -> 500 x 500
Source

Original
Cropped

Failure Cases

The Secret Sea Dragon

The energy function didn't weight the dragon's neck very strongly, leading to a dragon with a broken neck as the image got smaller.
1000 x 624 -> 700 x 500
Source

Original
Cropped

Lights

This image has too many diagonal lines and the seams break them every time one is removed.
800 x 534 -> 500 x 400
Source unknown. Was originally found in Google Image search and reverse image search provided no results.

Original
Cropped

City

The thin horizontal lines on the left of the image have severe artifacts from being thin horizontal lines caught in a seam.
1920 x 1080 -> 1280 x 720
Source

Original
Cropped