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 triggers a POST message will be sent to the API with metadata that belongs to the incident.
Message schema
Messages' content type is application/json. The content is described in proto in this document.
message Alert{
enum Type
{
UNKNOWN = 0;
CROWD_DETECTION = 1;
INTRUSION_DETECTION_CASCADING = 2;
}
string id = 1; ///< Global unique id of current event
uint64 timestamp = 2; ///< Timestamp of the last video frame in window
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
oneof value
{
CrowdDetectionDetails crowd_detection_details = 7; ///< Only for type=CROWD_DETECTION
IntrusionDetectionCascadingDetails intrusion_detection_cascading_details = 9; ///< Only for type=INTRUSION_DETECTION_CASCADING. Not set when heartbeat is true
}
}
message CrowdDetectionDetails {
repeated CameraRecord sources = 1; ///< Detection details per camera
}
message IntrusionDetectionCascadingDetails {
CameraRecord source = 1; ///< Detection detail from last frame
}
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
PERSON_FACE = 1; ///< Face detection result type
PERSON_FULL_BODY = 2; ///< Person detection result type
}
/** 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 detection (default and PTZ) example
{
"id": "1611842334668@mvp01.alert8.Alert.json",
"timestamp": 1611842334668,
"display_name": "Test Intrusion Det.",
"type": "INTRUSION_DETECTION_CASCADING",
"config_id": "alert8",
"heartbeat": false,
"crowd_detection_details": null,
"intrusion_detection_cascading_details": {
"source": {
"camera_id": "cam2",
"camera_display_name": "cam2 (117)",
"camera_technical_name": "cam2 tech. name",
"width": 1920,
"height": 1080,
"source_topic": "mvp01.cam2alert8DetFilterPort.ObjectDetectionRecord.json",
"frame_timestamp": 1611842334668,
"detections": [
{
"type": "PERSON_FULL_BODY",
"bounding_box": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"detection_confidence": 0.9
}
]
}
}
}
Crowd detection example
{
"id": "1606727720510@mvp01.alert12.Alert.json",
"timestamp": 1606727720510,
"display_name": "first alarm",
"type": "CROWD_DETECTION",
"config_id": "alert.12",
"heartbeat": false,
"crowd_detection_details": {
"num_of_people": 1,
"sources": [
{
"camera_id": "cam.1",
"camera_display_name": "first cam",
"camera_technical_name": "Outer_ID_01",
"width": 1920,
"height": 1080,
"source_topic": "mvp01.cam1alert12DetFilterPortObjectDetectionRecord.json",
"frame_timestamp": 1606727720510,
"detections": []
}, {
"camera_id": "cam.10",
"camera_display_name": "second cam",
"camera_technical_name": "Outer_ID_02",
"width": 1920,
"height": 1080,
"source_topic": "mvp01.cam10alert12DetFilterPortObjectDetectionRecord.json",
"frame_timestamp": 1606727720478,
"detections": [
{
"type": "PERSON_HEAD",
"bounding_box": {
"x": 1052,
"y": 415,
"width": 89,
"height": 112
},
"detection_confidence": 0.99902487
}
]
}
]
},
"intrusion_detection_cascading_details": null
}
Setup message sending in U-alarm
- Give unique technical names to cameras. The technical name will appear in the metadata and will aid the identification of the camera.
- 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.