OCR学习笔记(3)tesseract学习

OCR学习笔记(3)tesseract学习

tesseract介绍

Tesseract 是由惠普发布后谷歌维护的开源文字识别项目,从 Tesseract v4 开始宣布支持 深度神经网络 LSTM 进行文字识别。

win10下tessercat安装

(0)我的python版本为3.6.5
(1)下载地址:https://digi.bib.uni-mannheim.de/tesseract/
我选择的版本是:在这里插入图片描述
这里的版本需要与之后安装的tessorocr或pytesseract对应。
安装时不要勾选downloda内容,因为没有梯子下载会很慢或者失败。
(2)可以在GitHub上下载语言包:https://github.com/tesseract-ocr/tessdata
我选择的是中文语言包
在这里插入图片描述
之后将下载好的文件拷贝到Tesseract-OCR目录下的的tessdata文件夹中,并将tessdate文件夹复制一份到python安装目录下。
(3)添加环境变量
此处参考博客,博主解释的非常清楚 环境变量参考博客

pytesseract或tesserocr安装

(1)teseerocr包,安装过程为:
github上下载tesserocr-2.2.2-cp36-cp36m-win_amd64.whl 之后利用cmd进行安装。
代码:

import tesserocr
from PIL import Image
image = Image.open(r'F:\download\blueman00-text-detection-ctpn-master\text-detection-ctpn\ctpn\data\demo\010.png')
image_vert=tesserocr.image_to_text(image)
print(image_vert)

输入为:在这里插入图片描述
输出为:
在这里插入图片描述
(2)pytesseract安装
我直接在pycharm内安装
在这里插入图片描述
代码:

import pytesseract
from PIL import Image
image = Image.open(r'F:\download\blueman00-text-detection-ctpn-master\text-detection-ctpn\ctpn\data\demo\010.png')
image_vert=pytesseract.image_to_string(image)
print(image_vert)
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值