Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)