close

 

 

唉呦 ! 終於來到一個有趣的章節了,話說學習python也學習了一段時間了,
開始懂他的一些運用及一些方法,算是不錯玩,今天這一篇,就來寫簡單的
影像辨識吧 ! 

 

 

 

Step1. 下載庫

pytesseract 函數庫

https://github.com/UB-Mannheim/tesseract/wiki

 

 

 

Step2: 選擇自己的版本

image

 

Step3:

環境變數設定 → 本機 → 內容 → 進階系統設定 → 環境變數 → 系統變數 → path → 添加路徑(以安裝位置為主) C:\Program Files\Tesseract-OCR

 

 

 

Step4: 準備一張圖片 + 寫點Code

import pytesseract

def main():
    pytesseract.pytesseract.tesseract_cmd=r'C:\Program Files\Tesseract-OCR\tesseract.exe'

    text = pytesseract.image_to_string(Image.open('D:\\!*\\!*\\!Temp\\Image\\car1.jpg'))
    print(text)

if (__name__ == '__main__'):
    main()

image

image

 

 

arrow
arrow
    全站熱搜

    Eric 發表在 痞客邦 留言(0) 人氣()