Skip to content

Python Image Scanner for images from local hard drive. Searches for a rectangular object and transforms the perspective before scanning.

License

Notifications You must be signed in to change notification settings

Manu10744/image2scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image2scan

Purpose

image2scan is a python program that can be applied on an image in order to get a scan of it back. For this purpose, it searches for an rectangular object inside the image which is then processed and scanned. It even works on images where the angle of the document inside the image is oblique.

Generally, it performs good on images with enough contrast regarding the image and the rectangular object inside the image. It fails on images where the contrast is not sufficient to detect the edges or when there is no rectangular object (like a piece of paper) at all.

If it fails to detect 4 edges, the user is asked to define 4 points in order to determine the object to be scanned.

Steps

Determining the object

Outlined

Transforming perspective and scan

Scanned

Usage

The program can be applied on an image:

$ py scan.py --image <PATH_TO_IMAGE>

The directory for saving the scan PDF can be specified as well:

$ py scan.py --image <PATH_TO_IMAGE> --dest <PATH_TO_DIR>

If you want to check what its doing, you can also tell it to visualize the intermediate results in a GUI:

$ py scan.py --image <PATH_TO_IMAGE> --show-results

Installation

$ pip install -r requirements.txt

About

Python Image Scanner for images from local hard drive. Searches for a rectangular object and transforms the perspective before scanning.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages