Updated on 2024-02-29 GMT+08:00

Peak Crowd Counting

  • Data streams in JSON format are output to the specified DIS channels, including structured data and images.
  • Result example when the value of grid_x_number or grid_y_number is 0 (classic ROI settings):
    {
        "event_type": 1769472,
        "task_id": "taskcgtiad41",
        "stream_id": "test_camera",
        "timestamp": 1527603463,
        "message_id": "E87B6D7C-4FFD-11EA-AD9D-34B354BC6688",
        "image_base64": "/3j24AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
        "data": {
            "scene_type": 1,
            "alarm_type": 1,
            "total_crowd_count": 14,
            "event_set": [{
                "crowd_count": 14,
                "polygon": [
                    [400, 200],
                    [1280, 200],
                    [1280, 720],
                    [400, 720]
                ]
            }]
        }
    }
  • JSON format

    Field

    Type

    Description

    stream_id

    String

    Camera ID

    event_type

    Uint64

    Event type of the output message. The value is fixed to 1769472, which is 0x 0000 0000 001B 0000 in hexadecimal format.

    task_id

    String

    Task ID

    timestamp

    Uint64

    Time when the alarm is triggered

    message_id

    String

    Alarm ID in the form of a UUID

    image_base64

    String

    Base64 encoding results of the video image when the alarm is triggered

    data

    Object

    Service input content

  • data parameters

    Field

    Type

    Description

    scene_type

    Int

    Scenario type. The value is fixed to 1.

    alarm_type

    Int

    Alarm type. The value can be 0 or 1. If the value is 0, no alarm is reported, that is, the number of people does not exceed the alarm threshold. If the value is 1, only the number of detected people exceeds the alarm threshold.

    total_crowd_count

    Uint64

    Total number of people in all ROIs

    event_set

    List<Object>

    Output results list, including the polygonal area of each alarm and the alarm statistics of each region

  • event_set parameters

    Field

    Type

    Description

    polygon

    List<Object>

    Polygon area, which is formed by points in sequence, for example, [[400, 200], [1280, 200], [1280, 720] [400, 720]].

    The polygon area is the detection area specified by the user.

    crowd_count

    Int

    Number of people in the current region

  • Result example when the value of grid_x_number and grid_y_number is greater than 0, while target_roi is set to the lower right corner of the image:
    {
        "event_type": 1769472,
        "task_id": "taskcgtiad41",
        "stream_id": "test_camera",
        "timestamp": 1527603463,
        "message_id": "E87B6D7C-4FFD-11EA-AD9D-34B354BC6688",
        "image_base64": "/3j24AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",
        "data": {
            "scene_type": 1,
            "alarm_type": 1,
            "total_crowd_count": 14,
            "grid_width": 400, 
            "grid_height": 180, 
            "event_set": [{
                "grid_crowd_count": [
    		 [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    		 [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    		 [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    		 [-1,  0,  0,  4,  7,  8,  6,  4,  3,  4],
    		 [-1,  7,  3,  7,  5,  8,  3,  3,  1,  2],
    		 [-1,  6,  0,  6,  8,  7,  5,  2,  0,  6],
    		 [-1,  5,  6,  0,  0,  8,  8,  6,  7,  2],
    		 [-1,  4,  2,  8,  9,  1,  7,  5,  3,  5],
    		 [-1,  0,  1,  8,  4,  3,  1,  6,  2,  3],
    		 [-1,  3,  8,  0,  4,  5,  3,  3,  6,  3]
    	   ]
            }]
        }
    }
  • JSON format

    Field

    Type

    Description

    stream_id

    String

    Camera ID

    event_type

    Uint64

    Event type of the output message. The value is fixed to 1769472, which is 0x 0000 0000 001B 0000 in hexadecimal format.

    task_id

    String

    Task ID

    timestamp

    Uint64

    Time when the alarm is triggered

    message_id

    String

    Alarm ID in the form of a UUID

    image_base64

    String

    Base64 encoding results of the video image when the alarm is triggered

    data

    Object

    Service input content

  • data parameters

    Field

    Type

    Description

    scene_type

    Int

    Scenario type. The value is fixed to 1.

    alarm_type

    Int

    Alarm type. The value can be 0 or 1. If the value is 0, no alarm is reported, that is, the number of people does not exceed the alarm threshold. If the value is 1, only the number of detected people exceeds the alarm threshold.

    total_crowd_count

    Uint64

    Total number of people in all ROIs

    grid_width

    Int

    Video frame width/Number of horizontal grids. The value is rounded down.

    grid_height

    Int

    Video frame height/Number of vertical grids. The value is rounded up.

    event_set

    List<Object>

    Output results list, including the head counting result of each grid

  • event_set parameters

    Field

    Type

    Description

    grid_crowd_count

    List<Object>

    Number of people in each grid. The grid sequence is from left to right and from top to bottom. The value -1 indicates that the grid is outside the target_roi area.