工装检测
workwearDetect:工装检测
功能详情
上传一张图片,识别员工是否规范着装
备注:该产品属按需订阅的增值服务。开发者可通过工单或商务咨询申请免费额度进行测试,验证后再付费使用。
请求地址
https://openapi.lechange.cn/openapi/workwearDetect
传入参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 合法值 | 参数说明 | |
|---|---|---|---|---|---|---|
| token | String | 是 | 管理员accessToken | |||
| type | String | 是 | 数据类型,0-图片URL,1-Base64编码的二进制图片数据 | |||
| content | String | 是 | 图片数据,Base64编码的图片数据 或 图片URL。和type对应 | |||
| repositoryId | String | 否 | 人形工装检测目标库ID。传该值会从指定目标库检测图片中是否有匹配工装的人员 | |||
| threshold | Double | 是 | 检测阈值,范围 (0,1] | |||
| detectRegions | x | Float | 否 | 图片检测区域点位x坐标,归一化值[0,1]。最多设置3组检测区域 | ||
| y | Float | 否 | 图片检测区域点位y坐标,归一化值[0,1]。最多设置3组检测区域 | |||
关于detectRegion参数:
检测区域点位集合,最多3个检测区域。每个检测区域3到6个点,会转换成最大外接矩形再进行检测。
样例输入
{
"id":"d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"system":{
"ver":"1.0",
"appId":"lcdxxxxxxxxx",
"sign":"74bc756ebd53e9eef2836f8cf1730c10",
"time":1599031074,
"nonce":"8ec8a7bd1d1c95420de20d92422d457d"
},
"params":{
"token":"At_12345678901234567890123456789012",
"type":"0",
"content": "https://xxx.xx.xx/111.png",
"repositoryId":"xxxxxxxx",
"threshold":0.8,
"detectRegions":[
[
{
"x": 0.2,
"y": 0.4
},
{
"x": 0.3,
"y": 0.5
}
],
[
{
"x": 0.1,
"y": 0.3
},
{
"x": 0.2,
"y": 0.5
}
]
]
}
}
返回data字段说明
| 字段名 | 字段类型 | 字段说明 | ||
|---|---|---|---|---|
| targets | targetRegion | x | Float | 目标框左上角的横坐标,单位px,坐标原点为原图左上角 |
| y | Float | 目标框左上角的纵坐标,单位px,坐标原点为原图左上角 | ||
| width | Float | 目标框的宽度,单位px | ||
| height | Float | 目标框的高度,单位px | ||
| detectResult | Boolean | 是否符合着装,true-符合着装,false-不符合着装 | ||
样例输出
{
"result": {
"msg": "",
"code": "",
"data": {
"targets": [{
"detectResult": true,
"targetRegion": {
"x": 0.5,
"y": 0.6,
"width": 10.2,
"height": 10.8
}
}]
}
},
"id": ""
}