Computer Science 60
Principles of Computer Science
Spring 2012


Assignment 10: Seam Carving    [90 Points]
Due Monday, April 16, 11:59pm

This week's homework involves a cool application of Dynamic Programming!

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 (90 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 hw10files.zip<:br>

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.

What to do

Gradually extend the functionality of the program by doing more and more of SeamCarver.

Submission

Submit a working SeamCarver.java file. If you do the extra credit, make sure that the SeamCarver.java you submit here works with the original implementations of Main.java and CarverGUI.java!

Totally Optional Extra Credit: Fancier Seam Carving (+40 points or more)

If you have submitted SeamCarver.java, you can extend the seam carver with new, cool features. For this part, you may modify any or all files and/or add new files as necessary.

Submission

Include all the files necessary to run your program in a file extra.zip and submit this. Additionally, submit a separate file extra.txt that briefly explains what extensions you added, and (if necessary) instructions for how they should be used.