This program will crop arbitrary background from input image.
Example:
Input:
Output:
-
opencv
apt-get install libopencv-highgui-dev libopencv-dev
-
compiler
apt-get install build-essential
- set you pkg flags:
PKG_FLAGS=pkg-config opencv --cflags --libs
- run compilation
g++ -o autocrop autocrop.cpp $PKG_FLAGS ; chmod +x autocrop
autocrop <input_image_path> <output_image_path>
Example:
./autocrop input.png output.png