Seam Carving in C++

Seam Carving in C++

Seam carving is a content-aware image resizing technique where the image is reduced in size by one pixel of height (or width) at a time. This implementation is based on the paper Seam Carving for Content-Aware Image Resizing by Shai Avidan and Ariel Shamir. Built with C++ and OpenCV.

Building the project

  1. Make sure you have the following installed:

    • OpenCV version 4.9.0
    • CMake
    • gcc/g++
  2. Building the project:

cd build
make
  1. Running the project:
./SeamCarving <path_to_image> <iterations to reduce> <V | H> optional: <debug | demo>
ArgumentsDescription
path_to_imagePath to the image to resize.
iterationsNumber of pixels to reduce the image by.
V / HVertical or Horizontal seams resizing.
(optional) debug / demoDebug mode or Demo mode.

Features

  • Horizontal and vertical Resizing
  • Seam Carving with energy function
  • Debug and Demo modes

Demo