pictureDetect(图片检测)
pictureDetect:图片检测
功能详情
按 algorithmType 对一张图片做云端场景检测。图片通过 URL 或 Base64 传入。
当前仅支持四种 algorithmType:抽烟、玩手机、货架状态、垃圾满溢检测。须先开通对应 AI 服务 增值服务;未开通或传入其它取值会返回业务错误。与 AI 智见 套餐接口无关。
请求地址
POST https://openapi-[DataCenter].easy4ip.com/openapi/pictureDetect
最小权限
管理员 accessToken。
传入参数
| 参数名 | 参数类型 | 是否必填 | 参数说明 |
|---|---|---|---|
| token | String | 是 | 管理员 accessToken |
| type | String | 是 | 图片类型:0 图片 URL;1 Base64 编码的二进制图片数据 |
| content | String | 是 | 与 type 对应:图片 URL 或 Base64 字符串 |
| algorithmType | String | 是 | 算法类型 取值 smokingDetect(抽烟检测)、phoneUsingDetect(玩手机检测)、shelfStatusDetect(货架状态检测)、trashOverflowDetect(垃圾满溢检测) |
样例输入
{
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "b7e5bbcc6cc07941725d9ad318883d8e",
"time": 1599013514,
"nonce": "fbf19fc6-17a1-4f73-a967-75eadbc805a2"
},
"params": {
"token": "At_12345678901234567890123456789012",
"type": "0",
"content": "https://example.com/sample.jpg",
"algorithmType": "smokingDetect"
}
}
返回 data 字段说明
| 参数名 | 参数类型 | 参数说明 |
|---|---|---|
| detectResult | Boolean | 是否符合检测场景:true 符合;false 不符合 |
| targets | Array | 检测目标列表(部分算法返回) |
| targets[].targetRegion | Object | 检测到的目标位置,单位 px |
| targets[].targetRegion.x | Double | 左上角横坐标 |
| targets[].targetRegion.y | Double | 左上角纵坐标 |
| targets[].targetRegion.width | Double | 宽度 |
| targets[].targetRegion.height | Double | 高度 |
| targets[].detectResult | Boolean | 单目标是否符合场景(部分算法返回) |
| extensions | Object | 扩展返回值 |
| extensions.vacancyRatio | Double | 货架整体空缺占比;shelfStatusDetect 返回 |
| extensions.shelfItems | Array | 货架物品种类清单;shelfStatusDetect 返回 |
样例输出
{
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"result": {
"code": "0",
"msg": "操作成功.",
"data": {
"detectResult": true,
"targets": [
{
"targetRegion": {
"x": 120.0,
"y": 80.0,
"width": 64.0,
"height": 96.0
}
}
]
}
}
}
错误码
本接口可能返回通用网关与鉴权码;业务错误见 错误码。完整分组见 AI 分析。
