PHP实现人脸识别

$url,
        CURLOPT_POST=>true,
        CURLOPT_POSTFIELDS=>'faceimage='.$data_temp,
        CURLOPT_RETURNTRANSFER=>true
    )
);
$content=curl_exec($ch);
if(curl_errno($ch))
    echo curl_error($ch);
else{
    //echo "\n结果是\n";
    //var_dump($content);
    print_r($content);
}
curl_close($ch);

using UnityEngine;
using System.Collections;

public class CV2FaceDectect : MonoBehaviour {

    public delegate void FunctionResultHandle(string message);
    /// 
    /// 人脸识别
    /// 
    public IEnumerator IRequestJPG(Texture2D tex,FunctionResultHandle FunctionResult)
    {
        byte[] bs = tex.EncodeToJPG();
        WWWForm form = new WWWForm();
        form.AddBinaryData("image",bs,"image","image/jpg");
        WWW www = new WWW("http://我的服务器[上一篇文章有这个的源代码]/face.php",form);
        yield return www;
        if(www.error != null){
            FunctionResult(www.error);
        }
        else{
            FunctionResult(www.text);
        }
    }
}

你可能感兴趣的:(PHP实现人脸识别)