pictureDetect (Picture detection)
pictureDetect: Picture detection
What it does
Runs cloud scene detection on one image. Pass an image URL or Base64 data.
Only four algorithmType values are supported: smoking, phone use, shelf status, and trash overflow. Enable the matching AI services add-on first; other values or disabled accounts return business errors. Not related to AI Insight package APIs.
Request URL
POST https://openapi-[DataCenter].easy4ip.com/openapi/pictureDetect
Minimum permission
Administrator accessToken.
Request parameters
| Parameter name | Parameter type | Required or not | Parameter description |
|---|---|---|---|
| token | String | Yes | Administrator accessToken |
| type | String | Yes | Image source: 0 URL; 1 Base64-encoded binary image |
| content | String | Yes | URL or Base64 string matching type |
| algorithmType | String | Yes | Allowed values: smokingDetect, phoneUsingDetect, shelfStatusDetect, trashOverflowDetect |
Common request fields and signing: Signing conventions and Common request payload.
Sample input
{
"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"
}
}
Response data fields
| Field | Type | Description |
|---|---|---|
| detectResult | Boolean | true if the scene matches; false otherwise |
| targets | Array | Detected targets (some algorithms) |
| targets[].targetRegion | Object | Detected target position, in px |
| targets[].targetRegion.x | Double | Top-left X |
| targets[].targetRegion.y | Double | Top-left Y |
| targets[].targetRegion.width | Double | Width |
| targets[].targetRegion.height | Double | Height |
| targets[].detectResult | Boolean | Per-target match (some algorithms) |
| extensions | Object | Extended return values |
| extensions.vacancyRatio | Double | Overall shelf vacancy ratio; returned by shelfStatusDetect |
| extensions.shelfItems | Array | Shelf item category list; returned by shelfStatusDetect |
Sample output
{
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"result": {
"code": "0",
"msg": "Success.",
"data": {
"detectResult": true,
"targets": [
{
"targetRegion": {
"x": 120.0,
"y": 80.0,
"width": 64.0,
"height": 96.0
}
}
]
}
}
}
Error codes
Gateway and auth codes may apply. See Error codes and AI analysis.
