Tuesday, December 15, 2020

How to Compile and Install the Latest Tesseract OCR 4/5 on Debian 11 (Bullseye)

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

Jitsi TV HD: Native 720p @ 30fps USB Webcam Video Calls on Sony BRAVIA Android TV

Note: This is a personal hobby project built with AI-assisted coding and debugging to solve a specific Sony BRAVIA Android TV USB webcam iss...