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.
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.
Folder Structure is important
- In "input" folder place images to be cropped
- Crop script as in "src" folder
- Use the following command from command prompt
"python -m C:/.xx../src/CropImage.py
- 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