Python 進行 OCR識別 -- pytesseract庫


pip install pytesseract



報錯:tesseract is not installed or it's not in your path

識別中文需要新的字庫

圖片:English.png



圖片:Chinese.png



識別

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'))

結果





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM