""" 调用通用文字识别(高精度版) """
# client.basicAccurate(image)
@staticmethod
def gettext(filePath):
#print(filePath)
image = get_text.get_file_content(filePath)
""" 如果有可选参数 """
options = {}
options["detect_direction"] = "true"
options["probability"] = "true"
""" 带参数调用通用文字识别(高精度版) """
response = client.basicAccurate(image, options)
#print(response)
#data = response['words_result'][0]['words']
content = []
for info in response['words_result']:
#print(info['words'])
content.append(info['words'])
return content
if __name__ == '__main__':
get_text.gettext('D:/PycharmProjects/baiduaipOcr/example.jpg')
上一篇 文档/文件夹加密解密工具
下一篇 图片BASE64之间互相转换软件