tesseract-ocrHow do I set the Tesseract OCR environment variable?
The Tesseract OCR environment variable can be set in a few different ways.
- Using the
export
command in the command line:
export TESSDATA_PREFIX=/usr/local/share/tessdata
- Adding the
export
command to the~/.profile
file:
echo 'export TESSDATA_PREFIX=/usr/local/share/tessdata' >> ~/.profile
- Setting the environment variable in the application code:
# Python
import os
os.environ["TESSDATA_PREFIX"] = "/usr/local/share/tessdata"
# Java
System.setProperty("TESSDATA_PREFIX", "/usr/local/share/tessdata");
The environment variable TESSDATA_PREFIX
should be set to the path of the Tesseract data files.
Helpful links
More of Tesseract Ocr
- How to install Tesseract OCR on Windows?
- How can I use Tesseract OCR with Xamarin?
- How do I use Tesseract OCR with Yum?
- How can I use Tesseract OCR to recognize text in two languages?
- How can I use Tesseract OCR with Python?
- How can I use Tesseract OCR online?
- How can I use Tesseract OCR to get the position of text?
- How do I use Tesseract OCR in a Docker container?
- How can I use Tesseract OCR to recognize math formulas?
- How can I use Tesseract to perform zonal OCR?
See more codes...