当前位置: 移动技术网 > IT编程>脚本编程>Python > python实现图像文字识别

python实现图像文字识别

2020年08月01日  | 移动技术网IT编程  | 我要评论
1.安装python需要的包(1).pip install pillow.(2).pip install pytesser3(3).pip install pytesseract(4).pip install wheel2.安装Tesseract-OCR稳定版:https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-3.05.01.exe语言包:下载完成后放到百度网盘:链接: https://pan.bai

1.安装python需要的包

(1).pip install pillow.

(2).pip install pytesser3

(3).pip install pytesseract

(4).pip install wheel

2.安装Tesseract-OCR

稳定版:https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-3.05.01.exe

语言包:

下载完成后放到百度网盘:链接: https://pan.baidu.com/s/1phRCtsv3FKNORfOEvt9L1g 提取码: 4mcf 复制这段内容后打开百度网盘手机App,操作更方便哦

语言包位置:

3.安装配置环境

(1)TESSDATA_PREFIX

(2)PATH下增加

(3)修改python\Lib\site-packages\pytesseract\pytesseract.py

4.配置好环境后重启电脑,运行图像中文识别,和运行后识别的文字,图像放在自己项目下即可

# -*- coding: utf-8 -*-
# author: ZHT
# 图像识别初识

import pytesseract
from PIL import Image


image = Image.open('1.jpg')
code = pytesseract.image_to_string(image, lang="chi_sim+eng")
print(code)

本文地址:https://blog.csdn.net/qq_19897551/article/details/108263129

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网