问题描述:
在centos7 中做python的pytersseract验证码识别,在pytesseract.image_to_string时报错,经查解决办法是,升级tesseract。在centos中自带了tesseract3.03,github最新的稳定版本是 3.05.01。升级过程如下
-
准备工作
yum install gcc-c++ yum install autoconf automake libtool yum install autoconf-archive yum install pkg-config yum install libpng12-dev yum install libjpeg8-dev yum install libtiff5-dev yum install zlib1g-dev
-
安装Leptonica库
#centos 自带版本低于1.74,需要安装1.74及以上版本 wget http://www.leptonica.org/source/leptonica-1.74.4.tar.gz tar zxf leptonica-1.74.4.tar.gz ./configure make && make install #安装完成后,默认路径是/use/local/lib #使pkg-config读取这个路径 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
-
安装tesseract
wget https://github.com/tesseract-ocr/tesseract/archive/3.05.01.tar.gz tar -zxf tesseract-3.05.01.tar.gz ./autogen.sh ./configure make && make install
网友评论