Convert photos of documents made with a camera to a 'scanned' documents. It will the 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.
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 |
---|---|---|
Sample3
Run image-to-scan tests/samples/03/original.png
Original Image | Edge Detection | Warped Image |
---|---|---|
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for image_to_scan-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 413228f4d0ca7a4115814b673a6023e7786e8711d91694a26b2f3e52c18b456c |
|
MD5 | cce40c0015c1e82aca105b0aae0d8305 |
|
BLAKE2b-256 | 5a64e95f5e5c093561839d07710cac97202ecb559ceb1aea251858fdb07fe286 |