This project is a handwritten text recognition application that allows users to draw on a canvas and detect the handwritten text using OCR models. The project uses EasyOCR and TrOCR for text recognition.
canvas_widget.py
: Contains theCanvasApp
class for drawing on the canvas.gui.py
: Contains theDrawingApp
class for the main GUI application.main.py
: Entry point of the application.ocr_processor.py
: Contains theOCRProcessor
class for processing OCR text.trocr_model.py
: Contains theTrOCRModel
class for TrOCR model integration.
-
Clone the repository:
git clone <https://github.com/m01ali/OCR-Handwriting.git> cd <repository-directory>
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Use the canvas to draw handwritten text.
-
Click the "Detect Text" button to recognize the handwritten text.
-
Two images will be displayed in the workspace files:
- output.png: captures the output (word you wrote on canvas)
- enhanced_image.png: enhances the output image for the OCR model (This step has been added for better debugging purposes)
- EasyOCR: Used for general OCR tasks.
- TrOCR: Used for handwritten text recognition.
This project is licensed under the MIT License