OCR文字识别
可用路由表
通用OCR识别
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->general();
if($res->success()){
var_dump($res->toArray());
}else{
var_dump($res-->getErrMsg());
}
身份证识别
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->idcard([
'card_type' => 0 //0表示正面 1表示反面
]);
if($res->success()){
var_dump($res->toArray());
}
行驶证 驾驶证 识别
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->driverlicense([
'type' => 0 //0-行驶证识别 1-驾驶证识别
]);
if($res->success()){
var_dump($res->toArray());
}
营业执照识别
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->bizlicense();
if($res->success()){
var_dump($res->toArray());
}
银行卡
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->creditcard();
if($res->success()){
var_dump($res->toArray());
}
手写体
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->handwriting();
if($res->success()){
var_dump($res->toArray());
}
车牌
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->plate();
if($res->success()){
var_dump($res->toArray());
}
名片
$path = 'path/to/some.jpg';
$res = $ai->ocr()->path($path)->bc();
if($res->success()){
var_dump($res->toArray());
}
Last updated