Ubuntu版本:
1.tesseract-ocr安装
sudo apt-get install tesseract-ocr |
sudo pip install pytesseract |
sudo pip install pillow |
from PIL import Image from pytesseract import pytesseract image = Image.open('test.png') code = pytesseract.image_to_string(image,lang='chi_sim') print(code) |
# 安装训练数据(equ为数学公式包) sudo apt-get install tesseract-ocr-eng tesseract-ocr-chi-sim tesseract-ocr-equ |