This Python script demonstrates real-time translation of text captured from the screen using OCR (Optical Character Recognition) and DeepL API. The translated text is displayed on a Pygame window.
- Utilizes the EasyOCR library for text recognition from images.
- Implements DeepL API for language translation.
- Uses Pygame for creating a simple display window.
- Captures a portion of the screen using MSS (Python Screen Capture).
- Continuously updates the translated text in real-time.
- Python 3.x
numpy
,matplotlib
,PIL
,pygame
,easyocr
,mss
, anddeepl-python
libraries. Install them usingpip install
.
- Clone the repository or download the script file.
- Install the required Python packages mentioned in
requirements.txt
. - Replace
auth_key
variable with your DeepL API authentication key. - Run the script. It will open a Pygame window displaying the translated text.
- The script captures a specified portion of the screen using MSS.
- It recognizes text from the captured image using EasyOCR.
- The recognized Dutch text is translated into English using DeepL API.
- The translated text is displayed on a Pygame window.
- The process repeats continuously, updating the translated text in real-time.
- Ensure that the screen capture bounding box is adjusted according to your screen resolution and the area of interest.
- DeepL API requires an authentication key which can be obtained by signing up on the DeepL website.
This project is licensed under the MIT License.