msys2 |arch pacman|ubuntu:tesseract ocr 安装 - 思源笔记自动调用

安装之后,思源笔记能自动调用,ocr识别图片中的文字,可被搜索到。

思源笔记 > 使用指南 > 资源文件 中有一些说明。

windows msys2安装

pacman -S ***tesseract***, 包括:软件本体&语言支持包

pacman -S mingw-w64-ucrt-x86_64-tesseract-ocr\
mingw-w64-ucrt-x86_64-tesseract-data-chi_sim \
mingw-w64-ucrt-x86_64-tesseract-data-chi_sim_vert \
mingw-w64-ucrt-x86_64-tesseract-data-chi_tra \
mingw-w64-ucrt-x86_64-tesseract-data-chi_tra_vert \
mingw-w64-ucrt-x86_64-tesseract-data-eng

# 语言包还有:
# osd: Orientation and script detection
# equ: Math / equation detection

设置环境变量:

  • PATH: tesseract.exe所在文件夹,比如C:\softwares\msys2\msys64\ucrt64\bin
  • TESSDATA_PREFIX:语言包所在文件夹,比如C:\softwares\msys2\ucrt64\share\tessdata

不设置这个可能导致ocr乱码

存在的问题:

  • 有时ocr不准
  • 有时不对某些图片执行ocr

ubuntu (20.04)

添加源安装最新的(5.4.1, 24.9.18)

sudo add-apt-repository ppa:alex-p/tesseract-ocr5
apt show tesseract-ocr # 查看版本
sudo apt install tesseract-ocr
tesseract -v  # 查看版本

下载语言包,https://tesseract-ocr.github.io/tessdoc/Data-Files.html
放到目标位置:/usr/share/tesseract-ocr/5/tessdata

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值