AI系列網(wǎng)址:AI 系列 總目錄
我的博客地址:http://www.cnblogs.com/linbin524/p/8036158.html
前言
目前百度的AI接口相對(duì)完善,對(duì)于文字識(shí)別類的操作還需要開發(fā)者一一去嘗試,去評(píng)估這效果到底是怎么的。
文字識(shí)別的接口相對(duì)簡單,官方提供的SDK也集成很好,筆者只是在這上面做了一些前期性的功能數(shù)據(jù)校驗(yàn)和過濾,以及返回結(jié)果的處理。
實(shí)驗(yàn)效果
先來看一下識(shí)別效果:
1、精細(xì)化車牌(識(shí)別準(zhǔn)確)
2、實(shí)際場(chǎng)景車牌 (識(shí)別準(zhǔn)確)
3、多車牌(只識(shí)別到一個(gè)車牌)
實(shí)際拓展思路
鑒于上述結(jié)果,目前百度車牌識(shí)別可以做到 實(shí)際應(yīng)用場(chǎng)景的處理,但要真正結(jié)合、融合,需要開發(fā)者們自己做些前期處理,比如說,你需要在攝像頭捕捉車牌時(shí)候,自己去動(dòng)態(tài)抓取行駛車牌的車牌,
在使用單個(gè)請(qǐng)求將車牌發(fā)送給百度,從而實(shí)現(xiàn)在真實(shí)環(huán)境中的車牌識(shí)別。
ps:有關(guān)相關(guān)的技術(shù) 可以參考我另外一篇博客,動(dòng)態(tài)視頻中的人臉捕捉與人臉識(shí)別。 博客地址:http://www.cnblogs.com/linbin524/p/linbin524.html
///
/// 車牌識(shí)別 返回實(shí)體結(jié)果
///
///
///
public static APIBaseModel GetPlateLicense(Image tempImage)
{
APIBaseModel tempModel = new APIBaseModel();
tempModel.contextModel = new DrivingLicenseModel();
var client = new Ocr.Ocr(Config.clientId, Config.clientSecret);
var image = ImageHelper.ImageToBytes(tempImage, System.Drawing.Imaging.ImageFormat.Png);
string result = client.PlateLicense(image).ToString();
if (result.Contains("\"error_code\""))//說明異常
{
tempModel.state = false;
tempModel.contextModel.errorTypeModel = Json.ToObject(result);
tempModel.errorMsg = tempModel.contextModel.errorTypeModel.error_discription = OCR_CharacterRecognitionErrorType.GetErrorCodeToDescription(tempModel.contextModel.errorTypeModel.error_code);
}
else
{
tempModel.state = true;
tempModel.contextModel.successModel = Json.ToObject(result);
}
return tempModel;
}