This repository contains a working CMake based project you may use for writing your solution.
All packages necessary to build the project are defined inside the Dockerfile (Ubuntu 20.04 based).
Building the docker image:
cd seam-carving
docker build . -t seamcarving
Running the docker container:
docker run -v $(pwd):/workdir -it seamcarving bash
The above command maps the current working directory from the host OS to the /workdir directory inside the docker container.
Execute the following steps inside the docker container:
cd /workdir
cmake -S src -B build -G Ninja
cmake --build build
The following command runs the built seam-carving binary (executed from the docker container):
/workdir/build/seam-carving examples/castle.jpg
The process requires path to the input image passed as a mandatory command line argument. The generated output image created by your seam-carving algorithm is saved down to the filesystem in the current runtime directory (directory the docker container has been run from) under output.png name. You may open that file from your host OS file to see the result.
The seamCarving
function defined inside the seam_carving.cpp file is an entry point to your implementation.
Example images are located inside the examples/ directory.