Skip to content

fangxuanhao/AutomateImageCropUsingAI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AutomateImageCropUsingAI

Image Crop using Opencv python

This script can crop an image within the dark/black vertical and horizontal frame (as in a scanned/photographed copy) It will detect the roi automatically and define the picture size to crop.

Input:

In te above image, the picture to be cropped is surrounded with vertical and horizontal blck strips. Identifying these regions will give the roi. Thus we can extract the roi from inout image to crop the actual image from a scanned copy.

Resulting in an output:

How to Use

Folder Structure is important

  1. In "input" folder place images to be cropped
  2. Crop script as in "src" folder
  3. Use the following command from command prompt

"python -m C:/.xx../src/CropImage.py

  1. Crop image is placed in 'output' folder with defualt image name and file type.

Note: The script to crop image uses Opencv, Numpy. Mkae sure you ahve the latest versions instlled

About

Image Crop using Opencv python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%