from aip import AipOcr
App_ID="你的App ID"
API_Key="你的API Key"
Secret_Key="你的Secret Key"
client= AipOcr(App_ID,API_Key,Secret_Key)
i=open("G:\\IDLE\\chepai.jpg",'rb')
img=i.read()
message=client.basicGeneral(img)
for i in message.get('words_result'):
print(i.get('words'))
经过对车牌号的各种图像处理(包括车牌轮廓检测和车牌定位、裁剪)在我之前的博客中介绍过相关的算法车牌号识别定位,经过识别之后裁剪得到的车牌如下所示:
通过baidu-aip库,经上述代码得到如下结果:
识别的结果还是比较理想的,准确度较高。另外,baidu-aip库需要通过pip进行安装。