Tesseract OCR识图工具,通过composer接入hyperf使用

本文主要使用编译安装,yum安装未深入研究为何无法使用

一、下载依赖

sudo yum install -y gcc gcc-c++ make autoconf automake libtool pkgconfig
sudo yum install -y leptonica leptonica-devel

这里额外记录一下我踩的坑,第二个依赖安装的时候出现了一些状况

[root@ip-172-31-37-111 tesseract-5.2.0]# yum install -y leptonica leptonica-devel
Last metadata expiration check: 12:22:32 ago on Wed Jun 26 22:37:31 2024.
Package wget-1.21.3-1.amzn2023.0.3.x86_64 is already installed.
Error: 
 Problem 1: conflicting requests
  - nothing provides libpng15.so.15()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libpng15.so.15(PNG15_0)(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libgif.so.4()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libwebp.so.4()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
 Problem 2: package leptonica-devel-1.72-2.el7.x86_64 from epel requires leptonica(x86-64) = 1.72-2.el7, but none of the providers can be installed
  - package leptonica-devel-1.72-2.el7.x86_64 from epel requires liblept.so.4()(64bit), but none of the providers can be installed
  - conflicting requests
  - nothing provides libpng15.so.15()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libpng15.so.15(PNG15_0)(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libgif.so.4()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
  - nothing provides libwebp.so.4()(64bit) needed by leptonica-1.72-2.el7.x86_64 from epel
(try to add '--skip-broken' to skip uninstallable packages)

安装Leptonica依赖

没错,就是因为这里无法yum无法使用,我又一次选择了源码编译安装 ,需要注意的是,在使用ocr的时候需要Leptonica依赖版本超过1.74,所以可以先执行以下yum remove leptonica leptonica-devel删除依赖,如本机并无安装则忽略

wget https://github.com/DanBloomberg/leptonica/archive/refs/tags/1.82.0.tar.gz
tar -xzvf 1.82.0.tar.gz
cd leptonica-1.82.0

./autogen.sh
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值