[tesseract] Linux environment installation tesseract tutorial (2)

Image recognition using Python

1. Install Python3 third-party modules pytesseract, Pillow, packaging

Use the command: pip3 install pytesseract
After installation, we can directly enter the command: tesseract

2. Use Python for text recognition

import pytesseract
from PIL import Image
img=Image.open('test.png')
code=pytesseract.image_to_string(img,lang='chi_sim+eng')
print(code)

Save and exit, run the file
insert image description here
to output the recognized text normally

おすすめ

転載: blog.csdn.net/zhuan_long/article/details/126153914