tesseract-ocr4.0 安装部署及训练验证码识别

1.  下载最新版本的leptonica,  leptonica-1.74.1.tar.gz  

2.  编译安装

tar -zxvf leptonica-1.74.1.tar.gz
cd leptonica-1.74.1
./configure
make
sudo make install

3. 安装相关依赖库

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

4. 下载编译安装最新版本 tesseract-4.0, 

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

5. 使用

# 查看版本号
tesseract -v

# 查看tesseract 支持语言
tesseract --list-langs

# 识别 test.jpg 图片文字
tesseract test.jpg out -l eng
more out.txt

 

posted on 2017-02-19 20:58  星空守望者--jkmiao  阅读(784)  评论(0编辑  收藏  举报