1、If they are not already installed, you need the following libraries (Ubuntu 16.04/14.04):
1
2
3
4
5
6
7
|
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
|
1
2
3
|
sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev
|
3、install leptonica:
1
2
3
4
5
6
7
|
git
clone https://github.com/DanBloomberg/leptonica
cd leptonica
autoreconf -vi
./autobuild
./configure
make
make install
|
4、install tesseract:
1
2
3
4
5
6
7
|
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
|
1
2
|
make training
sudo make training-install
|
Now,You get the libtesseract.so and you can use it in your C++ programs.
If you have some question,welecome to comments!