webosquickinstall,高干女人军婚如山,退休高工之家
tesseract介绍
tesseract是一个挺不错的ocr引擎,目前的问题是最新的中文资料相对较少,过时、不准确的信息偏多。
tesseract是一个google支持的开源ocr项目,其项目地址:,目前最新的源码可以在这里下载。
实际使用tesseract ocr也有两种方式:1. 动态库方式 libtesseract 2. 执行程序方式 tesseract.exe
环境
安装
1.tesseract-orc
安装的时候需要自行选择安装的语言,一些其他国家的语言可以不选择安装,我之按安装了中文,英文和日语。安装过程和其他软件一样。
2.pytesseract
pip install pytesseract
配置环境
1.设置 tesseract-orc路径
默认情况下tesseract-orc是不被添加到系统的path路径的,这样在使用的时候发生filenotfounderror: [winerror 2]
系统找不到指定的文件错误。
解决方法:
设置训练集的位置
下载的默认训练集也没有添加到系统路径,会报错
pytesseract.pytesseract.tesseracterror: (1, 'error opening data file \\program files (x86)\\tesseract-ocr\\tessdata/chi_sim.traineddata')
解决方法:
设置环境变量 tessdata_prefix
c:\program files (x86)\tesseract-ocr\tessdata
实例程序
import pytesseract from pil import image image = image.open('test.png') code = pytesseract.image_to_string(image) print(code)
更多参考:https://pypi.python.org/pypi/pytesseract
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对移动技术网的支持。如果你想了解更多相关内容请查看下面相关链接
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
python求numpy中array按列非零元素的平均值案例
网友评论