This is a text/code companion for my YouTube video on using Tesseract OCR from Python.
If you would like a visual walkthrough and explanation, you can watch the video.
You must have Tesseract downloaded and installed on your machine: https://github.com/tesseract-ocr/tesseract
You must have python3 downloaded and installed on your machine: https://www.python.org/downloads/
-
Run
pip3 install -r ./requirements.txtto install pytesseract -
Update simple-tesseract-example.py or all-png-in-dir.py with the proper path for your directory structure.
-
Running
- Run
python3 ./simple-tesseract-example.pyto extract text from the specified image file
OR
- Run
python3 ./all-png-in-dir.pyto extract text from all png files in the specified directory
- Run