圖片識別文字 pytesseract安裝及使用


用於圖片識別文字的pytesseract,建議安裝5.0及以上版本,可解決pytesseract.pytesseract.TesseractError: (3221225477, '')這類的錯誤

建議下載5.0 或 3.05版本 ,鏈接如下
https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w32-setup-v5.0.0-alpha.20200223.exe(32 bit)
https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w64-setup-v5.0.0-alpha.20200223.exe(b4 bit)resp.

1、第一步安裝pillow 和 pytesseract 這兩個庫,pip install
2、安裝后,下載上面的tesseract安裝包,安裝

3、pytesseract 庫的配置,在python的安裝目錄下搜索 pytesseract.py,然后進行編輯。

找到 tesseract_cmd,改變它的值為剛才安裝 tesseract.exe 的位置
D:\server\Tesseract-OCR\tesseract.exe

4、下載語言庫,https://blog.csdn.net/qq_38161040/article/details/90727456
5、將下載后的語言庫解壓后,放到tesseract-OCR/tessdata目錄下

代碼如下:


免責聲明!

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



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