十行代码实现营业执照的OCR识别

# -*- coding: utf-8 -*-
from aip import AipOcr
""" 你的 APPID AK SK """
APP_ID = 'xxx'
API_KEY = 'xxx'
SECRET_KEY = 'xxx'

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
def get_file_content(filePath):
    with open(filePath, 'rb') as fp:
        return fp.read()
img_loc ='./1611310671779.jpg'
image = get_file_content(img_loc)
message = client.businessLicense(image)
words_result = message['words_result']
for i in words_result:
    print(i + ':' +str(words_result[i]['words']))

 






上一篇:阿里云ocr试用


下一篇:集装箱号码OCR识别SDK在港口理货系统中的应用