!!!tesseract官网有提供相关视频!!!
https://www.youtube.com/watch?v=vOdnt2h1U8U
https://www.youtube.com/watch?v=WZLJucXZy-g
!!!官网编译教程!!!建议完整看完后再作操作。
https://github.com/tesseract-ocr/tesseract/wiki/Compiling#linux
1)必要流程
If they are not already installed, you need the following libraries (Ubuntu 16.04/14.04)
sudo apt-get install g++ # or clang++ (presumably)
sudo apt-get install autoconf automake libtool
sudo apt-get install autoconf-archive
sudo apt-get install pkg-config
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg8-dev
sudo apt-get install libtiff5-dev
sudo apt-get install zlib1g-dev
if you plan to install the training tools, you also need the following libraries:
sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev
2)leptonica编译(有2种方式,一种是github源码,一种是压缩包,我使用github源码)
sudo apt install git
git clone https://github.com/DanBloomberg/leptonica
cd leptonica
autoreconf -vi
./autobuild
./configure
make
sudo make install
3)安装tesseract
cd
git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure --enable-debug
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
sudo make install
sudo ldconfig
tesseract -v
测试效果如下图