Scene Change Detection

Performs scene change and obstruction detection in a specified region of the video for OSHA compliance and other use cases.

Overview

The Scene Change Detection node keeps track of the changes in the ROI area in order to generate alarms if some anomaly is detected. It performs differentiated handling for objects types allowed to be within the ROI area bypassing the alarm in such case, and adds the OSHA analytics metadata to the frame metadata.

Inputs & Outputs

  • Inputs : 1, Media Format : Raw Video
  • Outputs : 1, Media Format: Raw Video
  • Output Metadata : Queue Information

Properties

PropertyDescriptionTypeDefaultRequired
roi_labelsRegions of interest labelsstringNo
roisRegions of interest. Conditional on roi_labels. Format: comma-separated normalized x,y coordinate pairs; separate multiple polygons with semicolons (for example, 0.1,0.1,0.9,0.1,0.9,0.9).stringnullNo
osha_compliance_typeOSHA compliance monitoring type. Options: Stacking of boxes/palettes < 7ft high (stacking); Pathways unblocked (pathway); Fire extinguishers unblocked (fire_extinguisher); Electrical panels unblocked (electrical_panel); Doors unblocked (door); Other - Generic (other).enumpathwayNo
objects_allowedObject classes that will bypass the alarm when present in the ROIs.model-labelspersonNo
change_thresholdAmount of change above which an alarm will be triggered for an ROI, adjusted for ROi size. Increase to reduce false alarms and reduce to detect smaller obstructions. Range: minimum 0, maximum 100.0. Step: 0.1. Unit: %.float1.5Yes
alarm_buffer_secondsTime for which an obstruction should be detected to trigger an alarm. Unit: seconds.number10No
detection_algorithmAlgorithm used to detect scene changes. SSIM is recommended for better accuracy. Options: Fast (edge): Uses edge detection to compare reference and current frames. Sensitive to lighting changes; Accurate (ssim): Uses SSIM with temporal smoothing. More robust to lighting changes and noise.enumedgeNo
reference_image_modeSet this property to 'No Update' after you have deployed once with the best reference image. Options: Latest stream snapshot (stream_snapshot); Live view at deployment start (deployment_start); No Update (no_update): Do not update the reference image. If no reference exists, set to live view at deployment start.enumstream_snapshotNo
reference_update_intervalWhen set to 0, load reference frame only in deployment initialization. Otherwise refresh every N seconds subject to the mode above, if no alarm is triggered. Set this to non-zero if you encounter false positives with gradually changing lighting patterns. Unit: seconds.number0No
processing_intervalMinimum time between scene change checks. 0 checks every frame. Increase to reduce CPU load at the expense of slightly delayed detections. Range: minimum 0, maximum 5000. Step: 100. Unit: milliseconds.integer0No
reference_update_triggerTrigger the reference image update subject using the mode above, when this condition evaluates to true.trigger-conditionnullNo
tracking_modeTracking mode. Options: Centroid (centroid); Top center (top-center); Bottom center (bottom-center); Left center (left-center); Right center (right-center); All points (all).enumcentroidNo
display_roiDisplay ROI on video? Options: Detailed (detailed); Simplified (simplified); None (none).enumdetailedNo
display_objectsDisplay objects on video?boolfalseNo
display_debug_infoDisplay debugging info?boolfalseNo

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
nodes.<node_id>.exception_alarm_rois_countintegerNumber of ROIs that are triggering an alarm
nodes.<node_id>.exception_alarm_rois_deltaintegerDifference of the number of ROIs creating alarm between last frame and this frame
nodes.<node_id>.exception_alarm_rois_idslistThe IDs of the ROIs that are generating an exception alarm
nodes.<node_id>.exception_allowed_rois_countintegerNumber of ROIs that are bypassing an alarm because there's an allowed object within the ROI area
nodes.<node_id>.exception_allowed_rois_idslistThe IDs of the ROIs that are bypassing an exception alarm
nodes.<node_id>.exception_allowed_rois_deltaintegerDifference of the number of ROIs bypassing alarm between last frame and this frame
nodes.<node_id>.clear_rois_countintegerNumber of ROIs that are not triggering any alarm
nodes.<node_id>.clear_rois_deltaintegerDifference of clear ROIs between last frame and this frame
nodes.<node_id>.reference_image_updatedbooleanSet as True in the frame the reference image is updated
nodes.<node_id>.rois.<roi_label>.typestringOSHA compliance monitoring type
nodes.<node_id>.rois.<roi_label>.change_scorefloatThe change score obtained from the comparison between the reference image and current frame
nodes.<node_id>.rois.<roi_label>.statestringThe state of the ROI can be either clear or alarm
nodes.<node_id>.rois.<roi_label>.time_since_last_state_changefloatThe amount of seconds passed since the state changed
nodes.<node_id>.rois.<roi_label>.coordsarrayArray of pixel coordinates defining the configured ROI or line.
nodes.<node_id>.rois.<roi_label>.change_thresholdfloatAmount of change above which an alarm will be triggered for an ROI
nodes.<node_id>.rois.<roi_label>.current_objects.<object_id>.first_seennumberPipeline timestamp when the object first entered the ROI.
nodes.<node_id>.rois.<roi_label>.current_objects.<object_id>.first_seen_utcstringUTC timestamp when the object first entered the ROI.
nodes.<node_id>.rois.<roi_label>.current_objects.<object_id>.time_presentnumberTime in seconds that the object has been present in the ROI.
nodes.<node_id>.rois.<roi_label>.current_objects.<object_id>.allowedbooleanBoolean indicating whether the object matches the configured allowed-object criteria.
nodes.<node_id>.monitoring_typestringOSHA compliance monitoring type
nodes.<node_id>.descriptionstring
nodes.<node_id>.typestringOSHA compliance monitoring type

JSON example

{
  "nodes": {
    "scene_change_detection1": {
      "clear_rois_count": 0,
      "clear_rois_delta": 0,
      "description": "value",
      "exception_alarm_rois_count": 0,
      "exception_alarm_rois_delta": 0,
      "exception_alarm_rois_ids": [],
      "exception_allowed_rois_count": 0,
      "exception_allowed_rois_delta": 0,
      "exception_allowed_rois_ids": [],
      "monitoring_type": "value",
      "reference_image_updated": false,
      "rois": {
        "roi1": {
          "change_score": 0.0,
          "change_threshold": 0.0,
          "coords": [],
          "current_objects": {
            "object_id": {
              "allowed": false,
              "first_seen": 0.0,
              "first_seen_utc": "value",
              "time_present": 0.0
            }
          },
          "state": 0,
          "time_since_last_state_change": 0.0,
          "type": "value"
        }
      },
      "type": "scene_change_detection"
    }
  }
}

Did this page help you?