If you have an image of a document and you would like to crop everything outside the document and correct the angle from which the photo was taken, in that case this command line tool might be for you.
Notes
Originally forked from KMKnation/Four-Point-Invoice-Transform-with-OpenCVThis code is inspired from 4 Point OpenCV getPerspective Transform Example
- Via pipx
pipx install image_to_scan
if you want to install inside an isolated environment. - Via pip
pip install image_to_scan
to an enviroment of your choice. - Download an executable for windows, linux or macos from the release page
image-to-scan
depends on opencv
and numpy
which together will take around 200MiB
If installed with pip
or pipx
you should be able to call image-to-scan
from the command line.
Run image-to-scan tests/samples/02/original.jpg
Original Image | Output Image |
---|---|
tests/samples/02/original.jpg |
tests/samples/02/original-scanned.jpg |