1 安装第三方Python库pytesseract
2 下载并安装Tesseract-OCR并配置中文语言包chi_sim.traineddata文件
3代码
import pytesseract
from PIL import Image
import glob,os
file_path=r"C:\\Users\\Administrator\\Desktop\\img\\"
images_path=glob.glob(os.path.join(file_path+"*.jpg"))
for i in images_path:
image = Image.open(i)
text = pytesseract.image_to_string(image,lang="chi_sim")
print(text)
3577

被折叠的 条评论
为什么被折叠?



