服務端 CentOS6.5 安裝 tesseract3.05

目前應用場景須要用到圖片文字識別,網上搜了一下,開源的庫tesseract口碑不錯,決定安裝試試。c++

下面主要描述服務端 CentOS6.5 安裝 tesseract3.05 版本。git

一、先更新依賴github

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-develcentos

#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測試

 

二、下載並安裝依賴程序leptonicaui

#Install Leptonica from Source
wget http://www.leptonica.com/source/leptonica-1.74.1.tar.gz
tar -zxvf leptonica-1.74.1.tar.gz
cd leptonica-1.74.1
./autobuild
./configure
make
make install
cd ...net

 

三、下載並安裝tesseract3.05blog

wget https://github.com/tesseract-ocr/tesseract/archive/3.05.zip圖片

unzip 3.05.zipip

cd tesseract-3.05/

./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 ..

 

四、下載語言包並放置到目錄 /usr/local/share/tessdata

cd /usr/local/share/tessdata

wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/chi_sim.traineddata

wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddata

 

五、能夠上傳一個小圖片作測試了

參考:

http://stackoverflow.com/questions/23792373/installing-tesseract-ocr-on-centos-6

http://blog.csdn.net/diandianxiyu_geek/article/details/50522582

相關文章
相關標籤/搜索