Document Scanner written in Python, mostly using cv2 library. 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.
What i had in my mind was the idea that i don't want to create another simple Document Scanner, so I asked myself what features I can add to make this project more interesting and more challeching. I came up with several concepts which later I implemented.
- scanning whole directory by using one command
- text scanner
- creating Neural Network for Language Recognition
- QR code Scanner
- interactive as also automatic selection of documents
Supported Languages: German, English, French, Italian, Portuguese and Spanish. NN correctly detects the language of the text 97% of the time. Check /src/language/langNN.ipynb for more information.
The UI code for the interactive mode is adapted from interacrer.py from matplotlib page.
python scanner (--images <IMG_DIR> | --image <IMG_PATH>) [-i] [-t] [-l] [-q]
- The
-iflag 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 - The
-tflag enables the text scanner, if text is found it is saves to txt file - The
-lflag enables the language recognition, if languge is recognised than the its acronym is add to the scanned filename. - The
-qflag enables the QR scannar, scanned code is also added to the scanned filename.
Here are some examples of images before and after scan:




