-
-
Save OlegJakushkin/31844c2d295dd30e223118656eedcd7e to your computer and use it in GitHub Desktop.
Install tesseract on centos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt | |
yum -y update | |
yum -y install libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel | |
#Install AutoConf-Archive | |
wget ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/a/autoconf-archive-2016.09.16-1.el7.noarch.rpm | |
rpm -i autoconf-archive-2016.09.16-1.el7.noarch.rpm | |
#Install Leptonica from Source | |
wget http://www.leptonica.com/source/leptonica-1.74.4.tar.gz | |
tar -zxvf leptonica-1.74.4.tar.gz | |
cd leptonica-1.74.4 | |
./autobuild | |
./configure | |
make | |
make install | |
cd .. | |
#Install Tesseract from Source | |
wget https://github.com/tesseract-ocr/tesseract/archive/3.05.01.tar.gz | |
tar -zxvf 3.05.01.tar.gz | |
cd tesseract-3.05.01 | |
./autogen.sh | |
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib | |
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make | |
make install | |
ldconfig | |
cd .. | |
#Download and install tesseract language files | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/ben.traineddata | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddata | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.traineddata | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/tha.traineddata | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata | |
mv *.traineddata /usr/local/share/tessdata | |
#Download Hindi Cube data | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.bigrams | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.fold | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.lm | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.nn | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.params | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.word-freq | |
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.tesseract_cube.nn | |
mv hin.* /usr/local/share/tessdata | |
ln -s /opt/tesseract-3.05.01 /opt/tesseract-latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes:
210 wget http://www.leptonica.com/source/leptonica-1.74.4.tar.gz
211 tar -xzf ./leptonica-1.74.4.tar.gz
212 wget https://github.com/DanBloomberg/leptonica/releases/download/1.74.4/leptonica-1.74.4.tar.gz
213 tar -xzf ./leptonica-1.74.4.tar.gz.1
214 ls
215 cd leptonica-1.74.4
216 ./autobuild
217 ./configure
218 make -j40
219 sudo make install
220 cd ..
221 cd tesseract/
222 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib --enable-opencl
223 LDFLAGS=-L/usr/local/cuda/lib64/ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib --enable-opencl