0
点赞
收藏
分享

微信扫一扫

Python提取图片中的文字

飞鸟不急 2021-09-28 阅读 69
技术

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()

举报

相关推荐

0 条评论