Skip to content

场景的识别

ink-image edited this page Jun 9, 2017 · 1 revision

1.图片上传接口

url(post消息):
"http://api.ink-image.com:9001/rest/1.0/ink_image/v1/upload?AppKey="+Key+"&AppSecret="+Secret+"&imageBody="+imageBody

参数说明:
Key:墨图科技分配给客户的唯一标识符
Secret:墨图科技分配给客户的唯一标识符
imageBody:经过Base64、URL编码后的图片内容

返回消息:
{"code":"Proc Succ","tagid":"42532ac6-67a2-4405-8995-3d99d6b80266"}
tagid是图片在服务器的uuid

使用例子(以java为例):

            String server = "http://api.ink-image.com:9001/";
           
            String imageBody = Base64.encode(readFile("test.jpg"));
            imageBody        = URLEncoder.encode(imageBody, "utf-8");
   
            //发送post消息函数需要用户实现
            HttpRequest.sendPost(server + "rest/1.0/ink_image/v1/upload", "AppKey=123456&AppSecret=U6VEsPIZXL35BmWaAEnsHZUv&imageBody="+imageBody);

2.场景识别接口

url(get消息):
"http://api.ink-image.com:9001/rest/1.0/ink_image/v1/scene_recog?AppKey="+Key+"&AppSecret="+Secret+"&uuid="+uuid

参数说明:
Key:墨图科技分配给客户的唯一标识符
Secret:墨图科技分配给客户的唯一标识符
uuid:图片在服务器的uuid,一般由服务器在上传接口返回的tagid

返回消息:
{"code":"Proc Succ","label":"park","probs":"0.77224349975586"}
label是场景名称;probs是识别该场景的概率

使用例子(以java为例):

            String server = "http://api.ink-image.com:9001/";
           
            String uuid = "42532ac6-67a2-4405-8995-3d99d6b80266";
          
            //发送get消息函数需要用户实现
            HttpRequest.sendGet(server + "rest/1.0/ink_image/v1/scene_recog", "AppKey=123456&AppSecret=U6VEsPIZXL35BmWaAEnsHZUv&uuid="+uuid);

场景识别典型调用说明

(1)调用上传接口
(2)调用场景识别接口

You can’t perform that action at this time.