Skip to content

XudongOliverShen/SeamCarver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seam Carving Content-Aware Image Resizing

Introduction

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.

Background

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.

Algorithm

See the report.

Usage

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

Example results

Gradually reducing the width, you will expect to the these output images.

avatar

The first 30 seams to be deleted are marked red in the original image for a simple illustration.

avatar

Contributors

  1. Xudong Shen (xudong.shen@u.nus.edu)
  2. Ruixi Chen (ruixi@u.nus.edu)

About

SeamCarver to resize an image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages