Skip to content

Fynmn/Textrac

Repository files navigation

🔎 Textrac


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.


💡 Features


  • Stand-alone Word Detection
  • Stand-alone Digit Detection
  • Real-time Webcam Text Detection
  • Screen Capture Text Detection

🔧 Pre-requisites before running


📚 Libraries (you may check the requirements.txt)
  • 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
📂 Others (you may choose any of these methods to download and install Tesseract)

📄 Note: You may find the documentation for Tesseract here: Tesseract Documentation on GitHub


❓ How to run?


  1. Make sure tesseract is installed. You can check if it is installed probably in your C:\Program Files\Tesseract-OCR directory if you're using Windows.
  2. Make sure all the necessary libraries are installed. To make sure, you can run all the pip install commands or you can manually check them with pip list command which lists all your currently installed libraries.
  3. Ready your assets (e.g. clear images with text, clear images with number/digits).
❓ How to run words_detection.py?
  1. Drag your assets(clear images with some text) to the img_words directory.
  2. Run the words_detection.py file.
  3. The program will ask you to enter the filename that you want use. Make sure that the file is in the img_words directory.
  4. The results will be shown. You may click the window and the Press the X key to exit.
❓ How to run digits_detection.py?
  1. Drag your assets(clear images with some numbers/digits) to the img_digits directory.
  2. Run the digits_detection.py file.
  3. The program will ask you to enter the filename that you want use. Make sure that the file is in the digits directory.
  4. The results will be shown. You may click the window and the Press the X key to exit.
❓ How to run webcam_text_detection.py?
  1. Prepare something readable with some text such as a book,
  2. Run the webcam_text_detection.py file.
  3. Put it closer to the camera/webcam once the webcam turns on.
  4. See the real-time text detection in the terminal/console.
  5. If you want to screencapture, you may Press the S key to save the image.
  6. The screencaptured image would then be saved in the root directory of this app.
  7. The results will be shown. You may click the window and the Press the X key to exit.

✨ Future Plans


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.

About

A text detection application made with Python and Tesseract.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages