Speed Estimation

Estimates speeds of objects and sets triggers based on low/high thresholds.

Overview

The Speed Estimation node estimates speeds of objects in a ROI and sets triggers based on low/high thresholds. This node makes it easy to build common use cases such as No running zones, traffic jams, etc.

This node requires a AI Model Node and a Track Objects Node before it in order to function properly.

Inputs & Outputs

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

Properties

PropertyValue
roisSemicolon separated list of areas in the video within which the Speed Estimation tracks these objects.

If none is specified, the Speed Estimation tracks objects within the entire frame.

Format: left1,top1,right1,bottom1; left2,top2,right2,bottom2

Ex: 10,10,100,100; 200,200,300,300
roi_labelsComma separated list of labels for each ROI in the rois list above.

Format: label1, label2

Ex: door, window
object_typesComma separated list of object types to measure speed.

Ex. car,person

Accepted formats:
object_label: any object of this type, with or without a classifier attribute. Example: car

object_label.class_type: any object of this type that has a specific classifier attribute. Example: car.red

object_label.*: any object of this type that has at least one classifier attribute. Example: car.* (this will match car.red, car.yellow, etc)
speed_unit- mph: Miles per hour. Requires a Camera Calibration node prior to this node.
- kph :Kilometers per hour. Requires a Camera Calibration node prior to this node.
- pph : Pixels per hour
- pps : Pixels per second.
speed_trigger_threshold_highSet a trigger when speed exceeds the high threshold..

Ex. 20
speed_trigger_threshold_lowSet a trigger when speed is below the low threshold.

Ex. 2
speed_trigger_threshold_stationarySet the object as stationary when speed is below the stationary threshold.
Ex. 0.5
display_objects_modeDisplay objects that meet this criteria on the video

Options:
- none : None
-triggered : Only those above or below the thresholds.
- regular : Any motion.
- irregular: Stop and go or hover motion.
- stationary: Stationary objects
- all : All
display_roiIf true, ROI will be drawn on video
tracking_modeWhich point of the object to track :
- centroid
- bottom-center
- top-center
-left-center
-right-center
analysis_windowAnalyze the last n seconds of an object's motion to determine motion type.

Ex. 10
speed_labels_to_addAdd the speed category or motion type to the object's classes. Use it to filter objects or report on them.

- all: Adds both speed_category and motion_type classes to object attributes
- none
- speed_category: Adds speed_stationary, speed_low, speed_medium, speed_high classes to object attributes.
- motion_type: Adds motion_stop_and_go, motion_hover, and motion_regular classes to object attributes.

Metadata

Metadata PropertyDescription
nodes.<node_id>Describes the ROIs monitored by this node, and their properties.
Format : as defined in the table below.

<node_id> for Speed Estimation Nodes is of the form annotate_speedX (ex. annotate_speed1)

Example

"nodes": {
    "annotate_speed1": {
        "type": "annotate_speed",
        "rois": {
            "<roi_label>": {
                "coords": [[<point1_x>, <point1_y>], 
                           [<point2_x>, <point2_y>], 
                           [<point3_x>, <point3_y>]],
                "average_speed": <int>,
                "objects_stationary_count": <int>,
                "objects_stationary_delta": <int>,              
                "objects_low_speed_count": <int>,
                "objects_low_speed_delta": <int>,
                "objects_medium_speed_count": <int>,
                "objects_medium_speed_delta": <int>,
                "objects_high_speed_count": <int>,
                "objects_high_speed_delta": <int>,   
                "objects_stationary": [object_id1, object_id2...],              
                "objects_low_speed": [object_id1, object_id2...],
                "objects_medium_speed": [object_id1, object_id2...],
                "objects_high_speed": [object_id1, object_id2...]
            }
        }
    }
}

Format

KeyTypeDescription
<roi_label>Array of dictionariesContains information about this specific ROI
<roi_label>.coordsArray of ArraysContains the bounding box coordinates that represent this ROI
<roi_label>.objects_low_speed_countIntegerNumber of objects currently in this ROI below thespeed_trigger_threshold_low_mph
<roi_label>.objects_low_speed_deltaIntegerNumber of new objects in the ROI whose speed was below speed_trigger_threshold_low_mph between last frame and this frame
<roi_label>.objects_medium_speed_countIntegerNumber of objects currently in this ROI between thespeed_trigger_threshold_low_mph and speed_trigger_threshold_high_mph
<roi_label>.objects_medium_speed_deltaIntegerNumber of new objects in the ROI whose speed was between speed_trigger_threshold_low_mph and speed_trigger_threshold_high_mph between last frame and this frame
<roi_label>.objects_high_speed_countIntegerNumber of objects currently in this ROI above thespeed_trigger_threshold_high_mph
<roi_label>.objects_high_speed_deltaIntegerNumber of new objects in the ROI whose speed was above speed_trigger_threshold_high_mph between last frame and this frame
<roi_label>.objects_low_speedList of long integersList of object IDs of low speed objects
<roi_label>.objects_medium_speedList of long integersList of object IDs of medium speed objects
<roi_label>.objects_high_speedList of long integersList of object IDs of high speed objects