Content-aware image resizing.
Seam carving is the resizing of images by removing the lowest-energy vertical and horizontal "seams."
This allows for dynamic resizing of existing images to fit a wide variety of screens and panels.
An excellent discussion of seam carving can be found at Princeton's Algorithms and Data Structures, Part II website.
A dynamic demonstration of seam carving is also available on YouTube.
This project was completed for Algorithms, Part II.
If you're in that course or related course right now, obey all honor code requirements before viewing this code.
I recommend that this code should only be viewed after you've completed your own implementation.
If you're super stuck, take a break, take a walk, and it will come to you; good luck.
These images were produced using the ResizeDemo.java
source file, available in the seamCarving-testing.zip file supplied by Princeton.
Original:
Source
Original:
Source
By U.S. Navy photo by Mass Communication Specialist 3rd Class Ryan Steinhour [Public domain], via Wikimedia
Commons
Original:
Source
Mjones3137 at English Wikipedia CC BY 3.0, via Wikimedia Commons
Original:
Source
By Peter Gronemann from Switzerland (Camel on a sand dune) CC BY 2.0, via Wikimedia Commons
Original:
Source