搜索识别目标 | POST Client-end-URL/search

功能

搜索图像目标

认证

请求参数:

字段名

类型

必须

描述

image

base64编码字符串

图像内容的base64编码字符串,支持JPG和PNG格式图像。

notracking

String

"true"的话仅返回检测到的targetId属性,没有trackingImage图像返回,WebAR默认建议带上降低请求延迟。

expectNumber

String

[1 - 10]之间整数,返回更多expectNumber个以内检索结果以及各结果score(0-1]

deviceId

String

仅专属云,需要设备id

deviceName

String

仅专属云,特定小系统做相机参数预处理

返回类型:

返回码

HTTPCODE

Status

Result

OK

200

0

result: { imageBody }

NO_RESULT

404

17

result: { message: "No result: there is no matching." }

NO_TARGET

500

18

result: { message: "Target not found: there is a matching but no target, please report this issue: IMAGE-UUID" }

TIMEOUT

408

19

result: { message: "Request timeout." }

OUT_OF_LIMIT

402

21

result: { message: "You have exceeded the limit of daily scanning." }

OUT_OF_QPS

200

21

result: { message: "Exceed your QPS limitation." }

RPC_ERROR

500

20

result: { message: "Error retrieving results." }

OTHER_ERROR

501

30

result: { message: "Other error occur: details" }

特别注意:

http默认8080端口的Client-end-URL

http header设置 Connection: Keep-Alive 优化重复连接开销

样例

POST /search/ 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": {
      "target": {
        "targetId":"e61db301-e80f-4025-b822-9a00eb48d8d2",
        "trackingImage":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
        "name": "easyar",
        "size": "5",
        "meta": "496fbbabc2b38ecs3460a...",
        "type": "ImageTarget",
        "modified":1514735000000
        "active":"1",
        "trackableRate": 0,
        "detectableRate": 0,
        “detectableDistinctiveness”:0,
        "detectableFeatureCount", 0,
        "trackableDistinctiveness", 0,
        "trackableFeatureCount", 0,
        "trackableFeatureDistribution", 0,
        "trackablePatchContrast", 0,
        "trackablePatchAmbiguity", 0
      }
    },
    "timestamp": 1514736000000
}

图片不存在

HTTP/1.1 404 NOT FOUND
Content-Type: application/json
{
  "statusCode": 17,
  "result": {
    "message": "No result: there is no matching."
  }
}