Tesseract OCR is Google's optical character recognition engine. Compiling the latest upstream release directly on Debian 11 ensures access to LSTM neural network model improvements and enhanced UTF-8 language model accuracy.
Prerequisites:
Leptonica image processing library • Autotools • C++17 compiler
Build and Installation Commands
# 1. Install build headers and Leptonica
sudo apt-get update
sudo apt-get install g++ autoconf automake libtool pkg-config libpng-dev libjpeg62-turbo-dev libtiff5-dev zlib1g-dev libleptonica-dev -y
# 2. Download and compile Tesseract
VERSION="4.1.1" # Or latest 5.x release
cd /usr/src
wget https://github.com/tesseract-ocr/tesseract/archive/${VERSION}.tar.gz
tar -zxf ${VERSION}.tar.gz
cd tesseract-${VERSION}
./autogen.sh
./configure --prefix=/usr/local
make -j$(nproc)
sudo make install
sudo ldconfig
# 3. Download traineddata language models (e.g., English and Persian/Arabic)
cd /usr/local/share/tessdata
sudo wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata
sudo wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/fas.traineddata
No comments:
Post a Comment