须要安装:
apt-get install autoconf apt-get install automake apt-get install libtool
-------------------------------------------------------------------------------------------------------------------------------------
安装过程,參考下面:
安装依赖包
sudo apt-get install autoconf automake libtool sudo apt-get install libpng12-dev sudo apt-get install libjpeg62-dev sudo apt-get install libtiff4-dev sudo apt-get install zlib1g-dev sudo apt-get install libicu-dev # (if you plan to make the training tools) sudo apt-get install libpango1.0-dev # (if you plan to make the training tools) sudo apt-get install libcairo2-dev # (if you plan to make the training tools)
解释
--------------------------------------------------------------------------
安装leptonica
tesseract依赖于leptonica,所以首先要下载安装leptonica
第一步:tar zxvf leptonica-1.73.tar.gz
第二步:cd leptonica-1.73
第三步:./configure --prefix=/usr/local/leptonica
第四步:make
第五步:make install
安装完毕之后,配置环境变量,
gedit /etc/bash.bashrc
在文件末尾,加入环境变量的配置
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/leptonica/lib/pkgconfig
export PKG_CONFIG_PATH
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/leptonica/
export CPLUS_INCLUDE_PATH
C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/leptonica/include/leptonica
export C_INCLUDE_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/leptonica/lib
export LD_LIBRARY_PATH
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/leptonica/lib
export LIBRARY_PATH
source /etc/bash.bashrc
gedit /etc/ld.so.conf
在文件末尾。加入
/usr/local/leptonica/lib
source /etc/ld.so.conf
----------------------------------------------------------------------------------------------------------------------------
下载tesseract.
第一步:unzip tesseract
第二步:cd tesseract
第三步:./autogen.sh 假设不报错
第四步:LIBLEPT_HEADERSDIR=/usr/local/leptonica/include/leptonica ./configure --prefix=/usr/local/tesseract --with-extra-libraries=/usr/local/leptonica/lib 【注意:tesseract依赖于leptonica】
第五步:make
第六步:make install
第七步:make training
第八步: sudo make training-install 【注意:是training-install,不是 training install】
安装完后
加入环境变量PATH,否则,须要每次到安装路径执行。
第九步:gedit /etc/bash.bashrc,末尾加入
PATH=$PATH:/usr/local/tesseract/bin
export PATH
第十步:source /etc/bash.bashrc
------------------------------------------------------------------------------------------------------------------------------------------------------
然后,打开终端
最后编辑:admin 更新时间:2024-07-04 12:22