python 圖片識別

安裝庫
pip install pytesseract
pip install Pillow

windows安裝 tesseract 中文識別
下載地址:https://digi.bib.uni-mannheim.de/tesseract/
運行安裝:tesseract-ocr-setup-4.00.00dev.exe
安裝路徑:C:\Anaconda3\Tesseract-OCR
安裝完成後設置環境變量
1、添加環境變量
python 圖片識別
2、添加系統變量
python 圖片識別
重啓

from PIL import Image
import pytesseract
text=pytesseract.image_to_string(Image.open('xxx.jpg'),lang='chi_sim') # 使用中文
print(text)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章