Skip to content

A C++ implementation of Seam-Carving -- a classic content-aware image resizing algorithm.

License

Notifications You must be signed in to change notification settings

insaneyilin/SeamCarving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeamCarving

A C++ implementation of Seam-Carving -- a classic content-aware image resizing algorithm.

Dependencies

  • CMake
  • OpenCV

Build

mkdir build
cd build
cmake ..
make

Usage


./seam_carving <input_image> <direction> <number of seams>
    <direction> should be 'h'(horizontally) or 'v'(vertically)

 Or

./seam_carving <input_image> <direction> <number of seams> <mode> <x> <y> <w> <h>
    <mode> should be 'r' or 'p', 'r' for removal, 'p' for protection
    <x> <y> <w> <h> specify the ROI.

Screenshots

carving vertically

./build/app/seam_carving ./test_images/HJoceanSmall.png v 80

object removal

./build/app/seam_carving ./test_images/HJoceanSmall.png v 85 r 112 80 85 58

object protection

without protection:

./build/app/seam_carving ./test_images/sunset.jpeg v 300

with protection:

./build/app/seam_carving ./test_images/sunset.jpeg v 300 p 734 354 210 217

About

A C++ implementation of Seam-Carving -- a classic content-aware image resizing algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published