如何使用人脸识别SDK为你的应用添加人脸识别功能

这家提供高识别率的人脸识别SDK,支持所有常有编程语言,识别率很高。

复制网站上的介绍,有兴趣的童鞋可以试下:

在线人脸识别(OFaceR)是一个基于互联网的服务和软件,它通过一张选定的照片在人脸数据库中进行比较,从而实现从一张数字照片中自动识别或验证一个人。典型地,它被应用于各类安全系统中。

基于XML的人脸识别API使你更容易让你的应用具备人脸识别的能力,无论是对于可执行文件(exe),网站应用(web),移动应用或手机应用(mobile)等。我们的API支持所有常用的编程语言,包括但不限于:C/C++、PHP、ASP、Perl、Python、Javascript和Java,并且支持所有主要的操作系统,包括但不限于:Window、Linux、Mac OS、iOS和Android安卓。

这里有一个PHP脚本范例,它演示如何实现一个人脸照片比对的调用:

<?php
$fp = fopen ('test.jpg', 'rb');
if (!$fp)
{
exit ('failed to open the picture file');
}

$photo = fread ($fp, filesize ('test.jpg'));
fclose ($fp);
if (!$photo)
{
exit ('failed to read file');
}

$photo = base64_encode ($photo);

$cmd = '<OFR_Request>
<Action>recognise</Action>
<Session_id>438058746</Session_id>
<Database_id>100000519</Database_id>
<Result_num>5</Result_num>
<Photo>' . $photo . '</Photo>
</OFR_Request>';

$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL, 'http://api.ofacer.com/do.x');
curl_setopt ($ch, CURLOPT_POSTFIELDS, array('ofr' => $cmd));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$a = curl_exec ($ch);
curl_close ($ch);
if (!$a)
{
exit ('ofr service error');
}

$r_xml = simplexml_load_string ($a);
if (isset($r_xml->error) && (string)($r_xml->error))
{
exit ((string)($r_xml->error));
}

$result_str = 'matching persons: '; $m_person_ids = array();
$m_rates = array();
foreach ($r_xml->match_persons->match_person as $match_person)
{
$result_str .= (string)($match_person->person_id) . ' (' . (string)($match_person->rate)/10000.0 . '%), ';
}

echo $result_str;
?>


详细的SDK在线文档在这里:http://www.ofacer.com/documents.cn.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值