美文网首页
Mac上安装tesseract

Mac上安装tesseract

作者: Lydia1991 | 来源:发表于2020-07-13 11:31 被阅读0次

    安装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)
    

    相关文章

      网友评论

          本文标题:Mac上安装tesseract

          本文链接:https://www.haomeiwen.com/subject/lrkacktx.html