Behaviors API Guide

Vision behavior is comprised of trajectory of all objects over time along with its associated metadata attributes like distance, speed etc.

Behaviors API Endpoints

Analytics Web API is exposed via Ingress Controller.

The URL prefix is http://<INGRESS-HOST-IP>:<INGRESS-PORT>/emdx/

Replace the INGRESS-HOST-IP with the Jetson device IP. Replace the INGRESS-PORT with 30080 or the last value defined in Ingress configuration.

Note

URL prefix path is subject to change in future release.

Retrieve all behaviors for a specific time range

Get behaviors for a given time duration for a given sensor:

HTTP GET

/api/behavior?sensorId=Amcrest_3&fromTimestamp=2020-10-30T20:00:00.000Z&toTimestamp=2020-10-31T01:00:00.000Z

Mandatory query parameters

sensorId

description: Sensor for which metadata is to be returned.

type: string

example: sensorId=Amcrest_3

fromTimestamp

description: Lower bound of the timestamp for which metadata needs to be returned.

type: UTC / GMT timestamp string

example: 2020-10-30T20:00:00.000Z

toTimestamp

description: Upper bound of timestamp for which metadata needs to be returned.

type: UTC / GMT timestamp string

example: 2020-10-30T20:05:00.000Z

Optional parameter

objectTypes

description: An optional objectTypes parameter used filter by object type (e.g person, car,…)

type: string

Possible way to filter by object type is as follows

1) To return counts for only specific type of objects in addition to cumulative counts across all types of objects. objectTypes=person,car

2) To return counts for all object types in addition to cumulative counts across all types of objects. objectTypes=*

  1. When objectTypes is not specified it returns only cumulative counts across all types of objects.

Response

HTTP GET

{
    "behavior": [
        {
            "sensor": {
                "id": "RedJD8H265"
            },
            "object": {
                "id": "134",
                "type": "person"
            },
            "locations": {
                "coordinates": [
                    [
                        1708598580297,
                        [
                            291,
                            594
                        ]
                    ],
                    [
                        1708598580364,
                        [
                            285,
                            594
                        ]
                    ],
                    [
                        1708598580474,
                        [
                            385,
                            694
                        ]
                    ],
                    [
                        1708598580372,
                        [
                            281,
                            595
                        ]
                    ]               ],
                "type": "linestring"
            },
            "length": 4,
            "endLocations": {
                "start": [
                    1708598580297,
                    [
                        291,
                        594
                    ]
                ],
                "end": [
                    1708598580372,
                    [
                        281,
                        595
                    ]
                ]
            },
            "start": "2024-02-22T10:43:00.297Z",
            "end": "2024-02-22T10:43:01.255Z",
            "distance": 204.81118737109063,
            "speed": 213.7903834771301,
            "timeInterval": 0.958
            "partial": true,
            "bearing": 175.4933931162317,
            "direction": "Left"
        }
    ]
}

Response body

sensor.id

The unique ID of the sensor.

object.id

The unique ID of the object.

locations.coordinates

e.g
[
    1708598580364,
    [
        285,
        594
    ]
]

An array of trajectory item, where each item is an array of two elements.

The first element is timestamp, i.e, 1708598580364.

The second element is an array of coordinates [x,y] i.e [285,594] where x=285 and y=594.

length

The number trajectory items in the locations.coordinates array.

start

The timestamp of the first trajectory item.

end

The timestamp of the last trajectory item.

endLocations.start

The first trajectory item. This corresponds to the first entry in the location.coordinates array.

endLocations.end

The last trajectory item. This corresponds to the last entry in the location.coordinates array.

distance

Total distance covered by object, which is sum of length of each trajectory segment. The unit if distance is pixel. Since camera calibration is not support as of now, everything is in camera coordinate system and the unit is in pixel.

speed

Average speed of the object. Distance travelled (in pixel) per second.

partial

Indicate that the trajectory items represents the complete trajectory of this object. Incase the trajectory items does not fully fall inside the requested fromTimestamp and toTimestamp then partial will be false.

Error Response

Response body: See Error response body definition at the end of the page.

HTTP Status codes:

422: No behavior found for the requested sensorId and time range 500: Internal server error

Error Response body

Error response for all API is JSON object with following attributes.

{
   "detail": "#Detailed error string",
   "status": "#http-status-code",
   "title": "Unprocessable Entity",
   "type": "about:blank"
}