Mac上安装tesseract
2020-07-13 本文已影响0人
Lydia1991
安装homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装完后进行测试
apple$ brew -v
Homebrew 2.2.13
Homebrew/homebrew-core (git revision 60c83; last commit 2020-04-28)
安装tesseract
brew install tesseract
安装完成后进行测试
appple$ 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.11 : libwebp 1.1.0 : libopenjp2 2.3.1
Found AVX2
Found AVX
Found FMA
Found SSE
使用python调用使用
import pytesseract
from PIL import Image
img = Image.open("test.png")
text=pytesseract.image_to_string(img)
print(text)