SDImagePreprocess/SmartCrop
2024-06-17 22:19:42 +02:00
..
images initial commit 2024-06-14 08:54:09 +02:00
CMakeLists.txt initial commit 2024-06-14 08:54:09 +02:00
facerecognizer.cpp initial commit 2024-06-14 08:54:09 +02:00
facerecognizer.h initial commit 2024-06-14 08:54:09 +02:00
incbin.h initial commit 2024-06-14 08:54:09 +02:00
intelligentroi.cpp initial commit 2024-06-14 08:54:09 +02:00
intelligentroi.h initial commit 2024-06-14 08:54:09 +02:00
log.cpp initial commit 2024-06-14 08:54:09 +02:00
log.h initial commit 2024-06-14 08:54:09 +02:00
main.cpp SmartCrop: fix debug image not being outputed in all cases where it should 2024-06-17 22:19:42 +02:00
options.h initial commit 2024-06-14 08:54:09 +02:00
readfile.h initial commit 2024-06-14 08:54:09 +02:00
README.md initial commit 2024-06-14 08:54:09 +02:00
seamcarving.cpp initial commit 2024-06-14 08:54:09 +02:00
seamcarving.h initial commit 2024-06-14 08:54:09 +02:00
tokenize.cpp initial commit 2024-06-14 08:54:09 +02:00
tokenize.h initial commit 2024-06-14 08:54:09 +02:00
utils.cpp initial commit 2024-06-14 08:54:09 +02:00
utils.h initial commit 2024-06-14 08:54:09 +02:00
yolo.cpp initial commit 2024-06-14 08:54:09 +02:00
yolo.h SmartCrop: fix debug image not being outputed in all cases where it should 2024-06-17 22:19:42 +02:00

SmartCrop

SmartCrop is an application that uses content aware croping using, seam carving and resizeing to bring a directory of images into the deisred size and aspect ratio for training. SmartCrop ist configurable to prioritize specific items or specifc persons in the images provided.

Requirements

  • cmake 3.6 or later
  • opencv 4.8 or later
  • A c++17 capable compiler and standard lib like gcc or llvm/clang
  • git is required to get the source

Building

The steps to build this application are:

$ git clone https://uvos.xyz/git/uvos/SDImagePreprocess.git
$ cd SDImagePreprocess
$ mkdir build
$ cmake ..
$ make

The binary can then be found in build/SmartCrop and can optionaly be installed with:

$ sudo make install

Basic usage

To process all images in the directory ~/images and output the images into ~/proceesedImages:

$ smartcrop --out processedImages ~/images/*

To also focus on the person in the image ~/person.jpg

$ smartcrop --out processedImages --focus-person ~/person.jpg ~/images/*

To also enable seam carving

$ smartcrop --out processedImages --focus-person ~/person.jpg --seam-carving ~/images/*

see smartcrop --help for more

Example

Content detected in image:

Content found in image

Cropped image based on content:

Cropped image