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