[問題] Tesseract系統找不到指定的檔案

作者: alansyue (alansyue)   2017-12-22 23:31:36
各位大大好,我是最近初學 Python 的初心者
目前是安裝 Anaconda,使用 Jupyter 寫程式碼
最近在看書邊跟著實作,想嘗試圖片辨識的功能
於是我去下載了Tesseract-ocr-3.05
並安裝在 C:\Program Files (x86)\Tesseract-OCR
並且下載了一張驗證碼的圖片,放在
C:\Program Files (x86)\Tesseract-OCR\media\test.jpg
之後跟著書上寫了下列程式碼:
import subprocess
ocr = subprocess.Popen("tesseract media\\test media\\result")
ocr.wait()
text = open("media\\result.txt").read().strip()
print(text)
執行一直跑出:FileNotFoundError: [WinError 2] 系統找不到指定的檔案。
試過改成絕對路徑也是發上同樣的狀況
想詢問大大們是哪裡出現問題,謝謝!
作者: TakiDog (多奇狗)   2017-12-23 14:15:00
你有cd到你要的路徑下嗎..tesseract指令我不記得長這樣

Links booklink

Contact Us: admin [ a t ] ucptt.com