3.
某用来识别车牌的Python程序如下:
from
aip import AipOcr
"""调用数据"""
APP_
ID= '15771331'
API_
KEY ='E9XtvDZwxk15p6cKsyZTXj6N'
SECRET_
KEY = 'xVHhhseU39VYEw8Y6QfFTuQQ8prQ55be'
client
= AipOcr(APP_ ID, API_ KEY, SECRET_ KEY)
"""读取图片"""
def
get_ file_ content(filePath):
with
open(filePath, 'rb') as fp:
return fp. read( )
image
= get file_ content('chepaijpg')
"""调用车牌识别"""
Client.licensePlate(image)
"""如果有可选参数"""
options=
{ }
options["multi_
detect"] = "true"
"""带参数调用车牌识别"""
a=client.
licensePlate(image, options)
b=a['words_
result'][0]['color']
c=a['words_
result'][0]['number']
print('识别结果:')
print('颜色:%s'
%b)
print('车牌:%s'
%c)
完成下列实践体验: