Mac上安裝tesseract-OCR


安裝homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安裝完后進行測試

brew -v

返回結果

Homebrew 2.1.1-38-ge68fc53
Homebrew/homebrew-core (git revision 4465d; last commit 2019-04-22)
Homebrew/homebrew-cask (git revision f909; last commit 2019-04-20)

安裝tesseract

brew install tesseract

安裝完成后進行測試

tesseract -v

返回結果

tesseract 4.1.1
leptonica-1.79.0
 libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.1.0 : zlib 1.2.5 : libwebp 1.1.0 : libopenjp2 2.3.1

使用python調用使用

import pytesseract
from PIL import Image

img = Image.open("test.png")
text=pytesseract.image_to_string(img)
print(text)


免責聲明!

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



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