小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

【新提醒】【unity進行文字圖像識別

 鴻蛟家平 2017-09-27
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using LitJson;
using UnityEngine.UI;
public class FaceTest1 : MonoBehaviour
{
    public string ImageURL = "";
    //按鈕上的文本
    public Text Btn_ShibieText;
    //顯示結果
    public GameObject ShowResult;
    // Use this for initialization
    void Start()
    {
    }
    // Update is called once per frame
    void Update()
    {
    }
    public void TestHttpSend()
    {
        //識別文字
        WWWForm form = new WWWForm();
        form.AddField("api_key", "q8QTfr-xS5hm-i25JuWRLmWQQSHRRtzy");
        form.AddField("api_secret", "3JAabNdllrl-Dm_-iYSG43B0ewypFlWt");
        form.AddField("image_url", ImageURL);
        StartCoroutine(SendPost("https://api-cn./imagepp/v1/recognizetext", form));
    }
    //提交數(shù)據(jù)進行識別
    IEnumerator SendPost(string _url, WWWForm _wForm)
    {
        WWW postData = new WWW(_url, _wForm);
        yield return postData;
        if (postData.error != "")
        {
            Debug.Log(postData.error);
            ShowResult.SetActive(true);
            Btn_ShibieText.text = "識別";
            ShowResult.transform.Find("Text").GetComponent<Text>().text = "識別失敗!";
            GameObject.Find("DebugText").GetComponent<Text>().text = postData.error;
            //myTimer = 2.0f;
        }
        else
        {
            Btn_ShibieText.text = "識別";
            Debug.Log(postData.text);
            GameObject.Find("DebugText").GetComponent<Text>().text = postData.text;
            JsonJieXi(postData.text);
        }
    }
    void JsonJieXi(string str)
    {
        JsonData jd = JsonMapper.ToObject(str);
        Debug.Log(jd["result"].Count);
        for (int i = 0; i < jd["result"].Count; i++)
        {
            for (int j = 0; j < jd["result"]["child-objects"].Count; j++)
            {
                Debug.Log(jd["result"]["child-objects"][j]["type"].ToString());
                Debug.Log(jd["result"]["child-objects"][j]["value"].ToString());
            }
        }
    }
     
}

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多