Textrac is a text detection app made with Python and Tesseract. It can run on any desktop machine provided that the machine has Python installed as well as all the prerequisites in running the app.
- Stand-alone Word Detection
- Stand-alone Digit Detection
- Real-time Webcam Text Detection
- Screen Capture Text Detection
- opencv -
pip install opencv-python - pytesseract -
pip install pytesseract - Pillow -
pip install pytesseract - re - comes with Python
- os - comes with Python
- numpy -
pip install numpy - tempfile - comes with Python
- Tesseract Installation(Binaries) on Windows
- Tesseract Installation(Binaries) on Ubuntu
- Tesseract Installation(Binaries) on Debian
- Source Code and Other Ways to Download and Install
📄 Note: You may find the documentation for Tesseract here: Tesseract Documentation on GitHub
- Make sure tesseract is installed. You can check if it is installed probably in your
C:\Program Files\Tesseract-OCRdirectory if you're using Windows. - Make sure all the necessary libraries are installed. To make sure, you can run all the
pip installcommands or you can manually check them withpip listcommand which lists all your currently installed libraries. - Ready your assets (e.g. clear images with text, clear images with number/digits).
- Drag your assets(clear images with some text) to the
img_wordsdirectory. - Run the
words_detection.pyfile. - The program will ask you to enter the filename that you want use. Make sure that the file is in the
img_words directory. - The results will be shown. You may click the window and the Press the
Xkey to exit.
- Drag your assets(clear images with some numbers/digits) to the
img_digitsdirectory. - Run the
digits_detection.pyfile. - The program will ask you to enter the filename that you want use. Make sure that the file is in the
digits directory. - The results will be shown. You may click the window and the Press the
Xkey to exit.
- Prepare something readable with some text such as a book,
- Run the
webcam_text_detection.pyfile. - Put it closer to the camera/webcam once the webcam turns on.
- See the real-time text detection in the terminal/console.
- If you want to screencapture, you may Press the
Skey to save the image. - The screencaptured image would then be saved in the root directory of this app.
- The results will be shown. You may click the window and the Press the
Xkey to exit.
Textrac is currently fully functional as a desktop/console app. There is one issue when it comes to splitting the text of the result in the Webcam Text Detection because it is not properly documented on how to do that.
Note: remove_noise.py can also be tweaked and integrated for additional image preprocessing. It was retrieved from here.