环境说明

操作系统版本:CentOS 7.7 x64
内核版本:3.10.0-1160.24.1.el7.x86_64
tesseract版本:5.0.1

安装c++17

  1. yum install centos-release-scl
  2. yum-config-manager --enable rhel-server-rhscl-7-rpms
  3. yum install devtoolset-7
  4. scl enable devtoolset-7 bash

安装leptonica-1.81.1

  1. # 安装gcc、gcc-c++、make
  2. yum install gcc gcc-c++ make
  3. # 安装编译相关工具
  4. yum install autoconf automake libtool
  5. # 安装对图片识别相关支持工具
  6. yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel
  7. # 编译letonica
  8. tar xf leptonica-1.81.1.tar.gz
  9. cd leptonica-1.81.1
  10. ./configure
  11. make
  12. make install

安装tesseract-5.0.1

  1. # 配置环境变量
  2. export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
  3. export LIBLEPT_HEADERSDIR=/usr/local/include
  4. export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  5. # 编译tesseract
  6. unzip tesseract-5.0.1.zip
  7. cd tesseract-5.0.1
  8. ./autogen.sh
  9. ./configure
  10. make
  11. make install
  12. ldconfig