已有相似目标图像 | POST /Similar/

功能

在图库中检查是否已有与目标图像类似的图像。推荐在创建一个新目标前使用此接口。

动作

POST /Similar/

认证

请求参数

字段名

类型

必须

描述

image

base64编码字符串

图像内容的base64编码字符串,支持JPG和PNG格式。文件最大2MB。

响应字段

返回相似图的result数组,每个result元素的内容见 POST /targets/

特殊说明

说明:如果列表为空,即results列表为空,表示没有相似的图片

样例

POST /similar/ HTTP/1.1
Host:
Date: Mon, 1 Jan 2018 00:00:00 GMT
Content-Type: application/json
{
    "image":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
    "timestamp": 1514736000000,
    "appKey": "test_app_key",
    "signature": "89985e2420899196db5bdf16b3c2ed0922c0c221"
}

返回

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 0,
    "result": {
        "date": "2016-06-15T09:58:51.000Z",
        "results":[
            {
                "targetId":"e61db301-e80f-4025-b822-9a00eb48d8d2",
                "trackingImage":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
                "name": "easyar",
                "size": "5",
                "meta": "496fbbabc2b38ecs3460a...",
                "type": "ImageTarget",
                "date": "2016-06-15T09:56:30.000Z",
                "active":"1",
                "active":"1",
                "trackableRate": 0,
                "detectableRate": 0,
                “detectableDistinctiveness”:0,
                "detectableFeatureCount", 0,
                "trackableDistinctiveness", 0,
                "trackableFeatureCount", 0,
                "trackableFeatureDistribution", 0,
                "trackablePatchContrast", 0,
                "trackablePatchAmbiguity", 0
            }
        ]
    },
    "timestamp": 1514736000000
}

样例实现:

EasyAR为开发者提供了几个语言的 Target Management Samples,方便程序调用实现自动化: