• tesseract 环境 linux


    python 环境

     wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

    chmod o+x Miniconda3-latest-Linux-x86_64.sh

    pip install Pillow
    pip install pytesseract
    pip install xlwt
    pip install requests

    centos7安装依赖库

    • 安装centos系统依赖

      yum install -y automake autoconf libtool gcc gcc-c++ 
      yum install -y libpng-devel libjpeg-devel libtiff-devel
    • 安装leptonica

      wget http://www.leptonica.org/source/leptonica-1.72.tar.gz
      tar xvzf leptonica-1.72.tar.gz
      cd leptonica-1.72/ 
      ./configure 
      make && make install
    • 安装tesseract-ocr

      wget https://github.com/tesseract-ocr/tesseract/archive/3.04.zip
      unzip 3.04.zip
      cd tesseract-3.04/ 
      ./configure
      make && make install 
      ldconfig  报错:error while loading shared libraries: libtesseract.so.3
    • 部署模型

    • 安装requirements.txt中的python依赖库

      pip install -r requirements.txt

    tesseract配置

    • 在/usr/local/share/tessdata创建eng.user-patterns写入

      
      
      
      
      
      
      

      表示识别6位字符(或数字)

    • 在/usr/local/share/tessdata/configs创建myconfig写入

      #识别白名单
      tessedit_char_whitelist abcdefghijklmnopqrstuvwxyz0123546789
      #用户正则模式匹配
      user_patterns_suffix user-patterns
  • 相关阅读:
    网页调用手机端的方法
    文章分类和标签的数据库设计
    linux 查看进程所在目录
    php-fpm 解析
    php-fpm.conf 解析
    php-fpm 操作命令
    php 获取 post 请求体参数
    获取请求 header 中指定字段的值
    redis 限制接口访问频率
    redis 常用操作
  • 原文地址:https://www.cnblogs.com/maoxianfei/p/9901730.html
Copyright © 2020-2023  润新知