Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sangamprashant/document-scanner
The Document Scanner is a Python project that automates the process of enhancing poorly scanned documents. It detects document corners, applies perspective transformation, sharpens the image, and enhances readability using OpenCV.
https://github.com/sangamprashant/document-scanner
document-scanner documet opencv python scan scanner
Last synced: 5 days ago
JSON representation
The Document Scanner is a Python project that automates the process of enhancing poorly scanned documents. It detects document corners, applies perspective transformation, sharpens the image, and enhances readability using OpenCV.
- Host: GitHub
- URL: https://github.com/sangamprashant/document-scanner
- Owner: sangamprashant
- Created: 2024-03-09T19:36:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-10T12:36:51.000Z (9 months ago)
- Last Synced: 2024-04-13T08:19:06.149Z (7 months ago)
- Topics: document-scanner, documet, opencv, python, scan, scanner
- Language: Python
- Homepage:
- Size: 5.19 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Document Scanner
### An interactive document scanner built in Python using OpenCV
The scanner takes a poorly scanned image, finds the corners of the document, applies the perspective transformation to get a top-down view of the document, sharpens the image, and applies an adaptive color threshold to clean up the image.
#### Here are some examples of images before and after scan:
## Usage
### clone the project
```
git clone https://github.com/sangamprashant/Document-Scanner.git
```### Without input
```
python scan.py (--images | --image ) [-i]
```- The `-i` flag enables interactive mode, where you will be prompted to click and drag the corners of the document. For example, to scan a single image with interactive mode enabled:`python scan.py --image uploads/sam.jpg -i`
![alt text](images/image2.png)
- Alternatively, to scan all images in a directory without any input:
`python scan.py --image uploads/sam.jpg`
check the output folder.### With Inputs
Create a virtual environment:
`python -m venv `
Activate the virtual environment:```
cd /Scripts
.\activate
cd ../..
```Install the requirements:
```
pip install -r requirements.txt
```Run the server :
```
python main.py
```- Open index.html in a browser and ensure that the path to the server is correct.
- Select the image to upload and see the magic happen.# Links
* [live link](https://sangamprashant.github.io/Document-Scanner/)
- output [server link](https://document-scanner-5nnp.onrender.com/) + response.data.result_path
- imput [server link](https://document-scanner-5nnp.onrender.com/scan)![](./images/image3.png)