Skip to content

olafrv/cropper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cropper

Cropper is a Python script that allows you to interactively select and crop multiple Regions of Interest (ROIs) from each JPEG file in the input directory. The cropped ROIs are saved as separate JPEG files in the output directory, together with the rois.json with the ROI data.

Cropper

Usage

To use the Cropper script, follow these steps:

git clone github.com/olafrv/cropper.git
cd cropper
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 cropper.py --input_dir composite/ --output_dir extracts/
# -------------------------------------------------
# How to use the GUI?
# - first, click and draw a ROI with the mouse
# - second, press the SPACE (or ENTER) afterwards
# - third, do the same for all other ROIs you want
# - fourth, press ESC to go to the next image
# -------------------------------------------------
# How to exit the GUI?
# - first, CRTL+C in the terminal 
# - lastly, press ESC in the GUI
# -------------------------------------------------

Why Cropper?

Majority of Image Croppers does not work with multiple ROIs, overlapping pictures, lack of borders or non-homogeneous backgrounds. AI is good for specific object detection but not for cropping pictures in pictures and training is not easy.

About

Crop and extract multiple Regions of Interest (ROIs) from JPEG files

Topics

Resources

Stars

Watchers

Forks

Languages