U_alarm
  • U-alarm
  • Quick Start Guide
  • User's Guide
  • Integration

›Integration

Contents

  • U-Alarm 3.0.0
  • U-Alarm release notes
  • Device Support
  • Quick Start Guide
  • User's Guide

    • User's Guide (main)
    • Installation
    • First Steps
    • Cameras
    • Alarms
    • Events
    • Control Panel (main)
    • - Schedule
    • - SSL settings
    • - SNMP settings
    • - Trusted Certificates
    • - System Update

    Integration

    • Integration (main)
    • Milestone XProtect Integration
    • E-mail sending
    • Custom Integration
    • Counter API

Custom Integration

U-Alarm is not only a standalone solution but can be used in an integrated system as well. All important information that belongs to an incident (eg. location, timestamp, detection coordinates, etc.) can be sent instantly to a third party software.

HTTP message

An external API endpoint can be set for each alarm. Whenever an alarm is triggered, a POST message will be sent to the API with metadata that belongs to the incident.

Message schema

The content type of messages is application/json. The content is described in proto in this document.

message Event{
  enum Type
  {
    UNKNOWN = 0;
    CROWD_DETECTION = 1;
    INTRUSION_DETECTION = 2;
    MULTI_OBJECT_DETECTION = 3;
    ZONE_CROSSING = 4;
    LOITERING_DETECTION = 5;
  }

  string id = 1; ///< Global unique id of current event
  uint64 timestamp = 2; ///< Timestamp of the last video frame in window OR timestamp of heartbeat.
  string display_name = 3; ///< Human readable name of source alarm configuration
  Type type = 4; ///< Type of source alarm configuration
  string config_id = 5; ///< id of source alarm configuration
  bool heartbeat = 6;

  oneof value
  {
    CrowdDetectionDetails crowd_detection_details = 7; ///< Only for type=CROWD_DETECTION. Not set when heartbeat is true
    IntrusionDetectionDetails intrusion_detection_details = 9; ///< Only for type=INTRUSION_DETECTION. Not set when heartbeat is true
    IntrusionDetectionDetails multi_object_detection_details = 10; ///< Only for type=MULTI_OBJECT_DETECTION. Not set when heartbeat is true
    IntrusionDetectionDetails zone_crossing_details = 11; ///< Only for type=ZONE_CROSSING. Not set when heartbeat is true
    IntrusionDetectionDetails loitering_details = 12; ///< Only for type=LOITERING_DETECTION. Not set when heartbeat is true
  }

  uint64 schema_version = 8;

}

message CrowdDetectionDetails {
  int32 num_of_people = 1; ///< Number of detected people
  repeated CameraRecord sources = 2; ///< Detection details per camera
}

message IntrusionDetectionDetails {
  CameraRecord source = 1; ///< Detection detail from last frame
  bool end_of_event = 2; ///< If true, Intrusion is over
}

message CameraRecord {
  string camera_id = 1; ///< ID of current camera
  string camera_display_name = 2; ///< Display name of current camera
  string camera_technical_name = 3; ///< Technical name of current camera
  int32 width = 4; ///< Frame width of the video stream
  int32 height = 5; ///< Frame height of the video stream
  string source_topic = 6; ///< Source topic name of detection
  uint64 frame_timestamp = 7; ///< Timestamp of current video frame
  repeated Detection detections = 8; ///< Details of detections
}

message Detection {
  ObjectType type = 1; ///< Type of detected object.
  Rect bounding_box = 2; ///< Rectangular box containing the detection.
  float detection_confidence = 3; ///< Confidence of the detection. Range: [0..1]
}

enum ObjectType
{
  PERSON_HEAD = 0; ///< Head detection result type. Supported event type CROWD_DETECTION
  PERSON_FULL_BODY = 1; ///< Person detection result type. Supported event type INTRUSION_DETECTION
  CAR = 2; ///< Car detection result type. Supported event type INTRUSION_DETECTION
  BUS = 3; ///< Bus detection result type. Supported event type INTRUSION_DETECTION
  BOAT = 4; ///< Boat detection result type. Supported event type INTRUSION_DETECTION
  TRUCK = 5; ///< Truck detection result type. Supported event type INTRUSION_DETECTION
  MOTORCYCLE = 6; ///< Motorcycle detection result type. Supported event type INTRUSION_DETECTION
  BICYCLE = 7; ///< Bicycle detection result type. Supported event type INTRUSION_DETECTION
  TRAIN = 8; ///< Train detection result type. Supported event type INTRUSION_DETECTION
  AIRPLANE = 9; ///< Airplane detection result type. Supported event type INTRUSION_DETECTION
}

/**  Rectangle
unit: pixels
*/
message Rect {
  int32 x = 1; ///< Horizontal coordinate of the upper left corner.
  int32 y = 2; ///< Vertical coordinate of the upper left corner.
  uint32 width = 3; // Rectangle width in pixels.
  uint32 height = 4; // Rectangle height in pixels.
}

/** Two dimensional point
range: [(0,0)..(width,height)); (0,0) is upper left corner
unit: pixels
*/
message Point {
  int32 x = 1; ///< Horizontal coordinate
  int32 y = 2; ///< Vertical coordinate
}
Intrusion example
{
  "id":"1648549923245@gustave..unscheduled.alert85..Event.json",
  "timestamp":1648549923245,
  "display_name":"Intrusion example",
  "type":"INTRUSION_DETECTION",
  "config_id":"alert85",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549923245,
      "detections":[
        {
          "type":"PERSON_FULL_BODY",
          "bounding_box":{
            "x":398,
            "y":35,
            "width":101,
            "height":140
          },
          "detection_confidence":0.65235364
        }
      ],
      "snapshot":""
    },
    "end_of_event":false
  },
  "multi_object_detection_details":null,
  "zone_crossing_details":null,
  "loitering_details":null,
  "schema_version":4
}
Multi object detection example
{
  "id":"1648549903243@gustave..unscheduled.alert87..Event.json",
  "timestamp":1648549903243,
  "display_name":"MOD example",
  "type":"MULTI_OBJECT_DETECTION",
  "config_id":"alert87",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":null,
  "multi_object_detection_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549903243,
      "detections":[
        {
          "type":"PERSON_FULL_BODY",
          "bounding_box":{
            "x":1283,
            "y":0,
            "width":62,
            "height":141
          },
          "detection_confidence":0.61611885
        }
      ],
      "snapshot":""
    },
    "end_of_event":false
  },
  "zone_crossing_details":null,
  "loitering_details":null,
  "schema_version":4
}
Zone Crossing example
{
  "id":"1648549594902@crossingProc_alert91",
  "timestamp":1648549594902,
  "display_name":"Zone Crossing example",
  "type":"ZONE_CROSSING",
  "config_id":"alert91",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":null,
  "multi_object_detection_details":null,
  "zone_crossing_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549594902,
      "detections":[
        {
          "type":"PERSON_FULL_BODY",
          "bounding_box":{
            "x":1090,
            "y":0,
            "width":425,
            "height":0
          },
          "detection_confidence":0.8925944
        }
      ],
      "snapshot":""
    },
    "end_of_event":false
  },
  "loitering_details":null,
  "schema_version":4
}
Loitering example
{
  "id":"1648549919844@loitering_alert93",
  "timestamp":"1648549919844",
  "display_name":"Loitering example",
  "type":"LOITERING_DETECTION",
  "config_id":"alert93",
  "heartbeat":false,
  "loitering_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":"1648549919844",
      "detections":[
        {
          "type":"PERSON_FULL_BODY",
          "bounding_box":{
            "x":1041,
            "y":25,
            "width":528,
            "height":0
          },
          "detection_confidence":0.938471615
        }
      ],
      "snapshot":""
    },
    "end_of_event":false
  },
  "schema_version":"4"
}

End of event

It is possible to include an End of Event timestamp, which triggers if 5 seconds have passed without incidents after the initial event that triggered the HTTP message. End of Event occurs once the incident is over.

  • End of intrusion example:
{
  "id":"1648549933230@gustave..unscheduled.alert85..Event.json",
  "timestamp":1648549933230,
  "display_name":"Intrusion example",
  "type":"INTRUSION_DETECTION",
  "config_id":"alert85",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549933230,
      "detections":[
        
      ],
      "snapshot":""
    },
    "end_of_event":true
  },
  "multi_object_detection_details":null,
  "zone_crossing_details":null,
  "loitering_details":null,
  "schema_version":4
}
  • End of multi object detection example:
{
  "id":"1648549908244@gustave..unscheduled.alert87..Event.json",
  "timestamp":1648549908244,
  "display_name":"MOD example",
  "type":"MULTI_OBJECT_DETECTION",
  "config_id":"alert87",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":null,
  "multi_object_detection_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549908244,
      "detections":[
        
      ],
      "snapshot":""
    },
    "end_of_event":true
  },
  "zone_crossing_details":null,
  "loitering_details":null,
  "schema_version":4
}
  • End of zone crossing example:
{
  "id":"1648549599103@crossingProc_alert91",
  "timestamp":1648549599103,
  "display_name":"Zone Crossing example",
  "type":"ZONE_CROSSING",
  "config_id":"alert91",
  "heartbeat":false,
  "crowd_detection_details":null,
  "intrusion_detection_details":null,
  "multi_object_detection_details":null,
  "zone_crossing_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":1648549599103,
      "detections":[
        
      ],
      "snapshot":""
    },
    "end_of_event":true
  },
  "loitering_details":null,
  "schema_version":4
}
  • End of loitering example:
{
  "id":"1648549928925@loitering_alert93",
  "timestamp":"1648549928925",
  "display_name":"Loitering example",
  "type":"LOITERING_DETECTION",
  "config_id":"alert93",
  "heartbeat":false,
  "loitering_details":{
    "source":{
      "camera_id":"cam76",
      "camera_display_name":"Example Camera",
      "camera_technical_name":"Example-Camera-tech-name",
      "width":1920,
      "height":1080,
      "source_topic":"",
      "frame_timestamp":"1648549928925",
      "detections":[
        
      ],
      "snapshot":""
    },
    "end_of_event":true
  },
  "schema_version":"4"
}

NOTE 1: detections is an empty array, and end_of_event is true.

NOTE 2: the id of this event is unique and it does not refer to any former event. This means that all events with this display_name and type are to be considered as having ended.

Crowd example
{
  "id":"1648549917244@gustave..unscheduled.alert89..Event.json",
  "timestamp":1648549917244,
  "display_name":"Crowd Example",
  "type":"CROWD_DETECTION",
  "config_id":"alert89",
  "heartbeat":false,
  "crowd_detection_details":{
    "num_of_people":1,
    "sources":[
      {
        "camera_id":"cam76",
        "camera_display_name":"Example Camera",
        "camera_technical_name":"Example-Camera-tech-name",
        "width":1920,
        "height":1080,
        "source_topic":"",
        "frame_timestamp":1648549917244,
        "detections":[
          {
            "type":"PERSON_FULL_BODY",
            "bounding_box":{
              "x":1440,
              "y":41,
              "width":129,
              "height":360
            },
            "detection_confidence":0.90866655
          }
        ],
        "snapshot":""
      }
    ]
  },
  "intrusion_detection_details":null,
  "multi_object_detection_details":null,
  "zone_crossing_details":null,
  "loitering_details":null,
  "schema_version":4
}

Snapshot sending

If enabled, Snapshots are sent to the following endpoint:

[PUT] YOUR_URL/snapshot/{event_is}/{c_t_n}

Its properties are as follows:

  • Content-Type: multipart/form-data

  • image media type: image/jpeg

Snapshot images, if enabled, are included in the schema in base64 encoded format, after the snapshot: part, in quotation marks (left empty in the examples).

Setup message sending in U-Alarm

  1. Give unique technical names to cameras. The technical name will appear in the metadata and will aid the identification of the camera.
  2. Fill HTTP client settings for each alarm. Give the address, the security credentials in a custom message header (if any) and cert settings for the external API.
← E-mail sendingCounter API →
  • HTTP message
    • Message schema
    • Snapshot sending
    • Setup message sending in U-Alarm
Help
Support
Navigation
OverviewQuick Start GuideUser's GuideIntegration
Community
GitHubFacebookLinkedInTwitterYouTube
Ultinous
Copyright © 2020 Ultinous