纯干货直接上代码

百度:

    from aip import AipOcr

    config = {
        'appId': '',
        'apiKey': '',
        'secretKey': ''
    }

    client = AipOcr(**config)

    def get_file_content(file):
        with open(file, 'rb') as fp:
            return fp.read()

    def img_to_str(image_path):
        image = get_file_content(image_path)
        image = image.content
        result = client.basicAccurate(image)
        if 'words_result' in result:
            return '\n'.join([w['words'] for w in result['words_result']])

谷歌:

# open image
    image = Image.open('')
    code = pytesseract.image_to_string(image, lang='chi_sim')
    print(code)

 

参考

↓↓↓↓↓↓↓

 

看这里

相关文章:

  • 2021-05-23
  • 2022-01-17
  • 2021-04-25
  • 2021-10-30
  • 2021-04-11
  • 2021-04-28
  • 2022-12-23
  • 2021-06-27
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案