This project implements the Seam Carving method from Shai Avidan et al.. It is only a class project so we only implemented a one-dimensional width reducing SeamCarver.
Effective image resizing should consider not only geometry but also image content, i.e., content-aware image resizing. Seam carving is a simple method, which builds on Hidden Markov Model (HMM), to achieve this. It resizes an image by successively deleting or duplicating a vertical/horizontal seam with lowest energy. In implementation, the optimal seam can be tracked using Viterbi algorithm.
See the report.
Firstly clone the project from this repo.
To reduce the width of an image to 100 pixels, use following command
python main.py -i input_image.jpg -o output_image.jpg -w 100
Gradually reducing the width, you will expect to the these output images.
The first 30 seams to be deleted are marked red in the original image for a simple illustration.
- Xudong Shen (xudong.shen@u.nus.edu)
- Ruixi Chen (ruixi@u.nus.edu)