..
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +02:00
2024-06-14 08:54:09 +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