Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
    • Public conventions
    • Development specification
    • accessToken: Get administrator token
    • API request example
    • Error codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • AI analysis
      • pictureDetect: Picture detection
      • detectDeviceSnap: Device snapshot detection
    • AI Insight
    • Legacy APIs (deprecated)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
What it does
Request URL
Minimum permission
Request parameters
Sample input
Response data fields
Sample output
Error codes
Related

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 nameParameter typeRequired or notParameter description
tokenStringYesAdministrator accessToken
typeStringYesImage source: 0 URL; 1 Base64-encoded binary image
contentStringYesURL or Base64 string matching type
algorithmTypeStringYesAllowed 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

FieldTypeDescription
detectResultBooleantrue if the scene matches; false otherwise
targetsArrayDetected targets (some algorithms)
targets[].targetRegionObjectDetected target position, in px
targets[].targetRegion.xDoubleTop-left X
targets[].targetRegion.yDoubleTop-left Y
targets[].targetRegion.widthDoubleWidth
targets[].targetRegion.heightDoubleHeight
targets[].detectResultBooleanPer-target match (some algorithms)
extensionsObjectExtended return values
extensions.vacancyRatioDoubleOverall shelf vacancy ratio; returned by shelfStatusDetect
extensions.shelfItemsArrayShelf 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.

Related

  • AI analysis
  • detectDeviceSnap
  • AI services
saveOauthUserQuota: Set OAuth user flow quota
detectDeviceSnap: Device snapshot detection