Skip to content

Instantly share code, notes, and snippets.

@dthphuong
Created March 9, 2021 03:41
Show Gist options
  • Save dthphuong/a1b7ec034a0065eb0d22dfa4758c4f28 to your computer and use it in GitHub Desktop.
Save dthphuong/a1b7ec034a0065eb0d22dfa4758c4f28 to your computer and use it in GitHub Desktop.
Install TesseractOCR 4.1.1 on CentOS
# ================Install Leptonca library================
# step 01
yum install -y zlib-devel libpng-devel openjpeg-devel libtiff-devel libwebp-devel libtool automake
#step 02
git clone https://github.com/DanBloomberg/leptonica
#step 03
cd leptonica
export CC=${CC:-gcc}
sh ./autogen.sh
#step 04
CFLAGS="-std=gnu99"
./configure CFLAGS="${CFLAGS}"
#step 05
make
make install
# ================Install Tesseract 4.1.1================
# step 01
wget https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz
# step 02
tar xvf 4.1.1.tar.gz
cd tesseract-4.1.1
export LIBLEPT_HEADERSDIR=/usr/local/include/leptonica
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
# step 03
./autogen.sh
# step 04
./configure --prefix= --with-extra-libraries=/usr/local/lib
# step 05
make
sudo make install
sudo ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment