A Python library that converts casual document snapshots into professional-quality scanned documents.
Project description
PhotoToScan
A Python library that converts casual document snapshots into professional-quality scanned documents.
This project makes use of the OpenCV-Document-Scanner from @andrewdcampbell and @joaofauvel, and the transform and imutils modules from @PyImageSearch (which can be accessed here).
Environment
uv - An extremely fast Python package and project manager, written in Rust.
Installation
pip install phototoscan
How To Use It
As a library
from phototoscan import Scanner
scanner = Scanner()
scanner.scan(<IMAGE_PATH>, output_dir=<OUTPUT_DIR>)
- output_dir is optional.
- If not specified, a folder named output will be automatically created at the same level as the input image.
- If the specified output directory does not exist, it will be created automatically.
As a command-line tool
To scan a single image:
uvx phototoscan --image <IMAGE_PATH> --output-dir <OUTPUT_DIR>
-
--output-dir is optional.
-
If not provided, a directory named output will be created next to the image file.
-
If the specified directory does not exist, it will be created automatically.
Scan all images in a directory
uvx phototoscan --images <IMAGES_DIR> --output-dir <OUTPUT_DIR>
- The same rules apply for --output-dir as above.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phototoscan-0.1.0.tar.gz.
File metadata
- Download URL: phototoscan-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cea55c5b9bfcd1ddc9ceed89b9cbfe9db0bc9d2e2b32d91d7eae0e51a2592a2d
|
|
| MD5 |
b1b407d46dd84beb4f52624e5f9123ae
|
|
| BLAKE2b-256 |
6f46fbac641dbce39767b31cac93ce8e237e012a430c383fd84a14869c490258
|
File details
Details for the file phototoscan-0.1.0-py3-none-any.whl.
File metadata
- Download URL: phototoscan-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e11ee05423d8f2007b17c4cfeff63ef03577314f91dd723ae1feeb5c3bd8ca4f
|
|
| MD5 |
f28be59b8b4d04c21ebdaac3b99be37a
|
|
| BLAKE2b-256 |
cf70339411b6c4ce8410603e7aaa833a1cabc81c610df552f51630a5655bca72
|