欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Python 进行 OCR识别 -- pytesseract库

程序员文章站 2022-05-29 07:56:22
pip install pytesseract 报错:tesseract is not installed or it's not in your path 下载安装 Tesseract OCR https://pan.baidu.com/s/1qXumxdltxOnb0geaE_1U Q 修改 p ......

pip install pytesseract



报错:tesseract is not installed or it's not in your path

识别中文需要新的字库

图片:english.png

Python 进行 OCR识别 -- pytesseract库

图片:chinese.png

Python 进行 OCR识别 -- pytesseract库

识别

import pytesseract
from pil import image

im_en = image.open('english.png')
im_ch = image.open('chinese.png')

print('========识别字母========')
print(pytesseract.image_to_string(im_en), '\n\n')

print('========识别中文========')
print(pytesseract.image_to_string(im_ch, lang='chi_sim'))


结果

Python 进行 OCR识别 -- pytesseract库