Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bensouchet/ipex
Image Paper EXtractor - Detect Sheets of Paper in Photographs, Extract & Straighten them!
https://github.com/bensouchet/ipex
computer-vision detection-algorithm document image-processing opencv4 python-3 scanner-app
Last synced: about 1 month ago
JSON representation
Image Paper EXtractor - Detect Sheets of Paper in Photographs, Extract & Straighten them!
- Host: GitHub
- URL: https://github.com/bensouchet/ipex
- Owner: BenSouchet
- License: mit
- Created: 2022-12-20T12:25:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-14T11:39:56.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T02:57:53.161Z (8 months ago)
- Topics: computer-vision, detection-algorithm, document, image-processing, opencv4, python-3, scanner-app
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IPEX : Image Paper EXtractor
### Detect Sheets of Paper in Photographs, Extract & Straighten them!
A `Python 3` command line script to detect & extract sheets of paper in images, the script use **OpenCV** and **NumPy**.
## Usage
Ensure you have a valid and working `python3`, `opencv` & `numpy` (Normally NumPy is a dependency of OpenCV, so you don't need to worry).
_Info : The script has been developed and tested on Python `3.11.0` & OpenCV `4.6.0`._
After cloning (or downloading) this repository:
```sh
python3 ipex.py -i ~/Desktop/IMG_3212.png
```
The paper sheets images extracted will be saved into a newly created folder inside `./results/`, if nothing has been generated please check the log in your terminal.### Multiple images
You can pass one or more images/photographs to the script like this:
```sh
python3 ipex.py -i ~/Desktop/IMG_3205.png ./contract.jpg ~/Documents/invoice.jpeg
```
Inside the result subfolder, extracted paper sheets will be named `paper_001.png`, `paper_002.png`, `paper_003.png`, ...## Debug
You can visualize some steps of the sheet detection by adding the argument `-d` or `--debug` to the script call:
```sh
python3 ipex.py -i ~/Documents/homework_03.jpeg -d
```
This will add debug images into the result subfolder.## Errors / Warnings
In case of an error you should see a formated log message in your terminal telling you exactly what is the issue.
If the script crash or something don't work you can open an issue [here](https://github.com/BenSouchet/ipex/issues).## Improvements
- use `numpy.ascontiguousarray` on images arrays to use them as output or dest array, reducing allocations
- Adding more timing debug to detect bottle necks in the process
- Expose `is_document` and `max_quality` to script arguments## Author / Maintainer
**IPEX** has been created and is currently maintained by [Ben Souchet](https://github.com/BenSouchet).
## Licenses
The code present in this repository is under [MIT license](https://github.com/BenSouchet/ipex/blob/main/LICENSE).