1. 程式人生 > >python 圖片識別

python 圖片識別

string 安裝路徑 col 4.0 路徑 tex str ext RoCE

安裝庫
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、添加環境變量
技術分享圖片
2、添加系統變量
技術分享圖片
重啟

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

print(text)

python 圖片識別