GithubHelp home page GithubHelp logo

bensouchet / ipex Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 52 KB

Image Paper EXtractor - Detect Sheets of Paper in Photographs, Extract & Straighten them!

License: MIT License

Python 100.00%
computer-vision detection-algorithm document image-processing opencv4 python-3 scanner-app

ipex's Introduction

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:

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:

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:

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.

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.

Licenses

The code present in this repository is under MIT license.

ipex's People

Contributors

bensouchet avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.