Skip to main content

Convert photos of documents made with a camera to a 'scanned' documents. It will take documents' contour and apply a four point transformation

Project description

Four-Point-Invoice-Transform-with-OpenCV

forked from KMKnation/Four-Point-Invoice-Transform-with-OpenCV

This code is inspired from [4 Point OpenCV getPerspective Transform Example]

I have customized the code of Adrian to find 4 points of document or rectangle dynamically. Here i have added findLargestCountours and convert_object, where convert_object is our driver method which actually doing image processing and getting all 4 point rectangles from image. After getting all 4 point rectangle list findLargestCountours method finding largest countour in list.

Installation

pip install image_to_scan

Run it

Before running the examples, create a virtual environment and install dependencies with make init, this will also add an entry point image-to-scan from which you can call the script.

Activate your virtualenv source venv/bin/activate.

Sample2

Run image-to-scan tests/samples/02/original.png

Original Image Edge Detection Warped Image
original Screen Warped

Sample3

Run image-to-scan tests/samples/03/original.png

Original Image Edge Detection Warped Image
original Screen Warped

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image-to-scan-0.0.4.tar.gz (3.3 MB view hashes)

Uploaded Source

Built Distribution

image_to_scan-0.0.4-py3-none-any.whl (12.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page