摘要:默認(rèn)為是否返回識(shí)別結(jié)果中每一行的置信度通用文字識(shí)別含生僻字版中英文混合默認(rèn)為是否檢測圖像朝向是否返回文字外接多邊形頂點(diǎn)位置,不支持單字位置。
The Best Image Ocr SDK For BAT.
百度 OCR
通用文字識(shí)別
通用文字識(shí)別(高精度版)
通用文字識(shí)別(含位置信息版)
通用文字識(shí)別(含位置高精度版)
通用文字識(shí)別(含生僻字版)
網(wǎng)絡(luò)圖片文字識(shí)別
銀行卡識(shí)別
身份證識(shí)別
駕駛證識(shí)別
行駛證識(shí)別
車牌識(shí)別
營業(yè)執(zhí)照識(shí)別
通用票據(jù)識(shí)別
Aliyun OCR
身份證識(shí)別
行駛證識(shí)別
駕駛證識(shí)別
門店識(shí)別
英文識(shí)別
營業(yè)執(zhí)照識(shí)別
銀行卡識(shí)別
名片識(shí)別
火車票識(shí)別
車牌識(shí)別
通用文字識(shí)別
Tencent OCR
名片識(shí)別
身份證識(shí)別
行駛證駕駛證識(shí)別
通用印刷體識(shí)別
項(xiàng)目地址 https://github.com/godruoyi/ocr
Feature自定義緩存支持;
符合 PSR 標(biāo)準(zhǔn),可以很方便的與你的框架結(jié)合;
命名不那么亂七八糟;
支持目前市面多家服務(wù)商
Support百度 OCR
騰訊 萬象優(yōu)圖
阿里 OCR
RequirementPHP > 5.6
composer
Installationcomposer require godruoyi/ocr
Laravel 5 拓展包
Usage基本使用(以百度OCR為例)
use GodruoyiOCRApplication; $app = new Application([ "ocrs" => [ "baidu" => [ "app_key" => "app_key", "secret_key" => "secret_key" ], ] ]); //身份證識(shí)別 $result = $app->baidu->idcard($filePath);
返回結(jié)果
{ "log_id": 530427582, "image_status": "normal", "words_result_num": 6, "words_result": { "住址": { "words": "上海市閔行區(qū)華漕鎮(zhèn)紅衛(wèi)村宗家巷1號" }, "出生": { "words": "19870723" }, "姓名": { "words": "鹿晗" }, "公民身份號碼": { "words": "123456789123456132X" }, "性別": { "words": "男" }, "民族": { "words": "漢" } } }各平臺(tái)支持的方法
詳情請參考官方文檔
所有平臺(tái)支持的方法中,都滿足以下結(jié)構(gòu):
$app->platform->$method($files, $options = [])
$files 的值可以為
文件路徑(完整)
SplFileInfo 對象
Resource
在線圖片地址(部分服務(wù)商不支持)
Array
百度OCR注:options 的值都是可選的
目前采用 AccessToken 作為 API 認(rèn)證方式,查看鑒權(quán)認(rèn)證機(jī)制
通用文字識(shí)別$app->baidu->generalBasic($file, [ "language_type" => "CHN_ENG", //支持的語言,默認(rèn)為CHN_ENG(中英文混合) "detect_direction" => false, //是否檢測圖像朝向 "detect_language" => false, //是否檢測語言,默認(rèn)不檢測 "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 ]);通用文字識(shí)別(高精度版)
$app->baidu->accurateBasic($file, [ "detect_direction" => false, //是否檢測圖像朝向 "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 ]);通用文字識(shí)別(含位置信息版)
$app->baidu->general($file, [ "recognize_granularity" => "big", //是否定位單字符位置 "language_type" => "CHN_ENG", //CHN_ENG:中英文混合;默認(rèn)為CHN_ENG "detect_direction" => false, //是否檢測圖像朝向 "detect_language" => false, //是否檢測語言,默認(rèn)不檢測 "vertexes_location" => false, //是否返回文字外接多邊形頂點(diǎn)位置,不支持單字位置。默認(rèn)為false "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 ]);通用文字識(shí)別(含位置高精度版)
$app->baidu->accurate($file, [ "recognize_granularity" => "big", //是否定位單字符位置 "detect_direction" => false, //是否檢測圖像朝向 "vertexes_location" => false, //是否返回文字外接多邊形頂點(diǎn)位置,不支持單字位置。默認(rèn)為false "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 ]);通用文字識(shí)別(含生僻字版)
$app->baidu->generalEnhanced($file, [ "language_type" => "CHN_ENG", //CHN_ENG:中英文混合;默認(rèn)為CHN_ENG "detect_direction" => false, //是否檢測圖像朝向 "vertexes_location" => false, //是否返回文字外接多邊形頂點(diǎn)位置,不支持單字位置。默認(rèn)為false "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 ]);網(wǎng)絡(luò)圖片文字識(shí)別
$app->baidu->webimage($file, [ "detect_direction" => false, //是否檢測圖像朝向 "detect_language" => false, //是否檢測語言,默認(rèn)不檢測 ]);身份證識(shí)別
$app->baidu->idcard($file, [ "detect_direction" => false, //是否檢測圖像朝向 "id_card_side" => "front", //front:身份證正面;back:身份證背面 (注意,該參數(shù)必選) "detect_risk" => false, //是否開啟身份證風(fēng)險(xiǎn)類型功能,默認(rèn)false ]);銀行卡識(shí)別
$app->baidu->bankcard($file, [ ]);駕駛證識(shí)別
$app->baidu->drivingLicense($file, [ "detect_direction" => false, //是否檢測圖像朝向 ]);行駛證識(shí)別
$app->baidu->vehicleLicense($file, [ "detect_direction" => false, //是否檢測圖像朝向 "accuracy" => "normal" // normal 使用快速服務(wù),1200ms左右時(shí)延,缺省或其它值使用高精度服務(wù),1600ms左右時(shí)延 ]);車牌識(shí)別
$app->baidu->licensePlate($file, [ "multi_detect" => false, //是否檢測多張車牌,默認(rèn)為false ]);營業(yè)執(zhí)照識(shí)別
$app->baidu->businessLicense($file, [ ]);通用票據(jù)識(shí)別
$app->baidu->receipt($file, [ "recognize_granularity" => "big", //是否定位單字符位置 "probability" => false, //是否返回識(shí)別結(jié)果中每一行的置信度 "accuracy" => "normal" // normal 使用快速服務(wù),1200ms左右時(shí)延,缺省或其它值使用高精度服務(wù),1600ms左右時(shí)延 "detect_direction" => false, //是否檢測圖像朝向 ]);Aliyun OCR
目前采用 APPCODE 作為 API 認(rèn)證方式,查看我的APPCODE
use GodruoyiOCRApplication; $app = new Application([ "ocrs" => [ "aliyun" => [ "appcode" => "40bc103c7fe6417b87152f6f68bead2f", ] ] ]);
身份證識(shí)別阿里云OCR不支持在線圖片地址
$app->aliyun->idcard($file, [ "side" => "face", //身份證正反面類型:face/back ]);行駛證識(shí)別
$app->aliyun->vehicle($file, [ ]);駕駛證識(shí)別
$app->aliyun->driverLicense($file, [ "side" => "face", //駕駛證首頁/副頁:face/back ]);門店識(shí)別
$app->aliyun->shopSign($file, [ ]);英文識(shí)別
$app->aliyun->english($file, [ ]);營業(yè)執(zhí)照識(shí)別
$app->aliyun->businessLicense($file, [ ]);銀行卡識(shí)別
$app->aliyun->bankCard($file, [ ]);名片識(shí)別
$app->aliyun->businessCard($file, [ ]);火車票識(shí)別
$app->aliyun->trainTicket($file, [ ]);車牌識(shí)別
$app->aliyun->vehiclePlate($file, [ "multi_crop" => false, //當(dāng)設(shè)成true時(shí),會(huì)做多crop預(yù)測,只有當(dāng)多crop返回的結(jié)果一致,并且置信度>0.9時(shí),才返回結(jié)果 ]);通用文字識(shí)別
$app->aliyun->general($file, [ "min_size" => 16, //圖片中文字的最小高度, "output_prob" => false, //是否輸出文字框的概率, ]);Tencent OCR
可登錄 云API密鑰控制臺(tái)查看你的個(gè)人 API 密鑰
use GodruoyiOCRApplication; $app = new Application([ "ocrs" => [ "tencent" => [ "app_id" => "1254032478", "secret_id" => "AKIDzODdB1nOELz0T8CEjTEkgKJOob3t2Tso", "secret_key" => "6aHHkz236LOYu0nRuBwn5PwT0x3km7EL", "bucket" => "test1" ], ] ]);
名片識(shí)別Tencent OCR 暫不支持在線圖片地址
$app->tencent->namecard($file, [ "ret_image" => 0, //0 不返回圖片,1 返回圖片, ]);身份證識(shí)別
$app->tencent->idcard($file, [ "card_type" => 0, //0 為身份證有照片的一面,1為身份證有國徽的一面 ]);行駛證駕駛證識(shí)別
$app->tencent->drivingLicence($file, [ "type" => 0, //識(shí)別類型,0表示行駛證,1表示駕駛證, ]);通用印刷體識(shí)別
$app->tencent->general($file, [ ]);
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/25959.html
摘要:納入深度學(xué)習(xí)模型來進(jìn)一步提升準(zhǔn)確率只是時(shí)間問題,事實(shí)上,這個(gè)時(shí)間已經(jīng)到來。最新版本支持基于深度學(xué)習(xí)的,準(zhǔn)確率顯著提高。該函數(shù)使用基于深度學(xué)習(xí)的文本檢測器來檢測不是識(shí)別圖像中的文本區(qū)域。高效使用概率最高的文本區(qū)域,刪除其他重疊區(qū)域。 By Adrian Rosebrock on September 17, 2018 in Deep Learning, Optical Character ...
摘要:一個(gè)簡單的圖片轉(zhuǎn)文字的函數(shù)實(shí)現(xiàn)如下。百度云這是偶然的發(fā)現(xiàn),百度云提供了一定額度的免費(fèi)的,目前是每日次,做做研究或者小應(yīng)用還勉強(qiáng)夠用,本文主要為了測試其效果。論中文,還是百度比谷歌更懂一點(diǎn)。 當(dāng)今時(shí)代人工智能都已經(jīng)是爛大街的詞了,OCR應(yīng)該也很多人都知道。 OCR (Optical Character Recognition,光學(xué)字符識(shí)別)是指電子設(shè)備(例如掃描儀或數(shù)碼相機(jī))檢查紙上打印...
摘要:目前已作為開源項(xiàng)目發(fā)布在,其最新版本已經(jīng)支持中文,并提供了一個(gè)命令行工具。他能夠用來識(shí)別英文,但是不能識(shí)別中文。所以要下載中文的識(shí)別包這樣就能識(shí)別中文。至少對印刷的中文字識(shí)別效果是很好的。 1. Tesseract 介紹 Tesseract的OCR引擎最先由HP實(shí)驗(yàn)室于1985年開始研發(fā),至1995年時(shí)已經(jīng)成為OCR業(yè)內(nèi)最準(zhǔn)確的三款識(shí)別引擎之一。然而,HP不久便決定放棄OCR業(yè)務(wù),Te...
閱讀 2651·2021-11-19 09:56
閱讀 921·2021-09-24 10:25
閱讀 1707·2021-09-09 09:34
閱讀 2245·2021-09-09 09:33
閱讀 1082·2019-08-30 15:54
閱讀 595·2019-08-29 18:33
閱讀 1297·2019-08-29 17:19
閱讀 533·2019-08-29 14:19