百度AI图形识别为我们提供丰富的应用场景
  • 目前实际应用中在慢慢展开尝试:
    1
    2
    3
    4
    百度OCR文字识别API服务
    图形图片识别 图片检测
    人脸检测 审核身份
    鉴黄鉴暴 图片抽帧 (尝试)

简单使用

image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Created by PhpStorm.
* User: wei
* Date: 2017/06/02
* Time: 15:21
* 文字卡证识别
*/

require_once "./AipOcr.php";
const APP_ID = 'your_id';
const APP_KEY = 'your_key';
const APP_SECRET_KEY = 'your_secret';
$aipChar = new AipOcr(APP_ID,APP_KEY,APP_SECRET_KEY);

$array_image = array(
file_get_contents('./carId.jpg'),
file_get_contents('./carId2.jpg'),
file_get_contents('./person.jpg'),
file_get_contents('./person2.jpg'),
file_get_contents('./driver_id.jpg'),
file_get_contents('./ticket_bak.png'),
file_get_contents('./timg.jpg'),

);
// 如果有可选参数
$options = array();
$options["language_type"] = "CHN_ENG";
$options["detect_direction"] = "true";
$options["detect_language"] = "false";
$options["probability"] = "true";
//普通识别

/*$info = $aipChar->basicGeneral($array_image['3'],$options);
echo "<pre>";
print_r($info);*/

image

1
2
3
4
5
6
7
8

//高精度识别
/*$info = $aipChar->basicAccurate($array_image['1'],$options);
echo "<pre>";
print_r($info);die;*/

$idCardSide = 'front';
// 如果有可选参数

image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//身份证 正反面识别
/*$options = array();
$options["detect_direction"] = "true";
$options["detect_risk"] = "false";
$info = $aipChar->idcard($array_image[2],$idCardSide,$options);
echo "<pre>";
print_r($info);*/
$idCardSide = 'front';
// 如果有可选参数
/*$options = array();
$options["detect_direction"] = "true";
$options["detect_risk"] = "false";
$info = $aipChar->idcard($array_image[3],$idCardSide,$options);
echo "<pre>";
print_r($info);*/


//驾驶证识别
/*$options = array();
$options["detect_direction"] = "true";
$info = $aipChar->drivingLicense($array_image[4],$options);
echo "<pre>";
print_r($info);die;*/

//普通票据
$options = array();
$options["recognize_granularity"] = "big";
$options["probability"] = "true";
$options["accuracy"] = "normal";
$options["detect_direction"] = "true";

$info = $aipChar->receipt($array_image[6],$options);
echo "<pre>";
print_r($info);

参考链接-百度AI