A web-based Optical Character Recognition (OCR) application using Flask and pytesseract, supporting multiple languages and flexible image input methods.
- Python 3.8+
- pip package manager
sudo apt-get update
sudo apt-get install tesseract-ocr
sudo apt-get install tesseract-ocr-ben # For Bengali language support
- Download Tesseract OCR installer from official GitHub
- Add Tesseract to system PATH
flask
flask-cors
opencv-python-headless
pytesseract
numpy
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
python server.py
- Server runs on
http://localhost:5000
- Open
example-use.html
in browser
- Image upload via file selection
- Image extraction via URL
- Multi-language OCR support
- Base64 image preview
- Error handling
- English
- Bengali
- Configurable via API parameters
/extract-text
(POST)- Accepts: Image file or image URL
- Returns: Extracted text and base64 image
Doc generated by help of AI