Computer Science 60
Principles of Computer Science
Fall 2012


Assignment 10: Seam Carving    [100 Points]
Due Monday, December 3rd, 11:59pm

This week's homework involves a cool application of Dynamic Programming!
Trouble viewing the equations/math in this webpage? This is a link to a pdf version that should contain all of those expressions in a readable form.

Pair Programming

You may do this assignment as a pair, if you wish. However, remember that working as a pair obligates you to obey the course pair-programming guidelines:

Seam Carving (100 Points)

Seam carving was first published in this paper by S. Avidan and A. Shamir in 2007. It's a relatively accessible paper, and you'll want to have this link available to refer to it as you implement seam carving. The approach uses dynamic programming in order to quickly find the lowest-cost seam from top to bottom or from left to right in an image. Repeated removal of seams allows for image-aware resizing to any smaller size. (The paper offers a seam-insertion algorithm for resizing to larger sizes, too, though that won't be our first priority here.)

This assignment starts with the files in hw10.zip

Unless you do the extra credit, you only need to modify SeamCarver.java. (You are very welcome to look at the other files, if you want to learn how they work.)

Make sure you can compile and run the main function, found in Main.java. Unlike Spampede, this is a “normal” Java program, not an applet. This means that it's not as easy to post on a web page, but it also means you can run it just fine inside DrJava.

If Main.java is not open in DrJava, you may need to type run Main in the Interactions window; otherwise, the Run button will work. You should get a window with a default image, and the ability to load new images by giving a URL, but none of the other buttons should do anything.

If you would like to run SeamCarver in Eclipse, you'll need to set the "Working Directory."