python利用baidu-aip对车牌号进行文字识别

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进行安装。

发布了81 篇原创文章 · 获赞 22 · 访问量 7676

猜你喜欢

转载自blog.csdn.net/qq_38883271/article/details/103646803