Building a document scanner with OpenCV and extract the text from image after preprocessing the image Python-tesseract is an optical character recognition (OCR) tool for python. That is, it will recognize and "read" the text embedded in images
In this project I preprocess the image for better text extraction.
I had used two preprocessing method. This switch is optional and it accept either of two values: thresh (threshold) or blur .
pip install pillow
pip install pytesseract
python ocr.py --image (your-image-name)
python ocr.py --image example_03.jpg
Building a document scanner with OpenCV can be accomplished in just three simple steps:
Step 1: Detect edges.
Step 2: Use the edges in the image to find the contour (outline) representing the piece of paper being scanned.
Step 3: Apply a perspective transform to obtain the top-down view of the document.
pip install pillow
pip install pytesseract
pip install --upgrade imutils
pip install opencv-python
- `python scan.py
Just follow☝️ me and Star⭐ my repository