A C++ implementation of Seam-Carving -- a classic content-aware image resizing algorithm.
- CMake
- OpenCV
mkdir build
cd build
cmake ..
make
./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.
./build/app/seam_carving ./test_images/HJoceanSmall.png v 80
./build/app/seam_carving ./test_images/HJoceanSmall.png v 85 r 112 80 85 58
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