美文网首页
Python提取图片中的文字

Python提取图片中的文字

作者: ZoranLee | 来源:发表于2020-10-20 12:24 被阅读0次

python版本

  • 3.7.7

安装 pytesseract

  • pip install pytesseract
import pytesseract
from PIL import Image

def run():
    image = Image.open("code.jpeg")
    code = pytesseract.image_to_string(image)
    # text = pytesseract.image_to_string(image, lang='chi_sim')
    print(code)

if __name__ == '__main__':
    run()

相关文章

网友评论

      本文标题:Python提取图片中的文字

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