Line Crossing Counter
Counts how many particular tracked objects crossed each line
Overview
The Line Counter node keeps track of the number of objects that cross a virtual line in the video, the direction they cross it in, and adds the line counting metadata to the frame metadata. This node makes it easy to build common use cases such as People counting, Parking lot occupancy counting, etc.
This node supports Lines with one or more segments, allowing you to be as granular as you need for your counting needs.
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 : Line Counter Information
Properties
Property | Value |
---|---|
objects_to_track | Comma separated list of Detected Object labels to track, as specified in Model Labels 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) |
display_line | Boolean. If line information will be displayed on the video stream Ex. true / false |
display_objects | Boolean. If objects will be displayed on the video stream Ex. true / false |
lines | Semicolon separated list of lines in the video across which this node tracks these objects. Each line can have multiple segments and can be defined by two or more points ( x1,y1,x2,y2,x3,y3 ).Format: line1_x1,line1_y1,line1_x2,line1_y2; line2_x1,line2_y1,line2_x2,line2_y2 Ex: 10,10,100,100; 200,200,300,300 |
line_labels | Comma separated list of labels for each ROI in the rois list above.Format: label1, label2 Ex: door, window |
dir1_label | Label for Direction 1 (Red color in the Lines widget). Optional. Ex. entry |
dir2_label | Label for Direction 2 (Red color in the Lines widget). Optional. Ex. exit |
persistent_storage | Boolean. If true, the following analytics will be stored in disk and restored when the pipeline restarts: [line_label]['total_objects_crossed'] [line_label]['dir1_objects_crossed'] [line_label]['dir2_objects_crossed'] Ex. true / false |
Metadata
Metadata Property | Description |
---|---|
nodes.<node_id> | Describes the Lines monitored by this node, and their properties. Format : as defined in the table below. <node_id> for Line Counter Nodes is of the form annotate_line_counterX (ex. annotate_line_counter1 ) |
Example
"nodes": {
"annotate_line_counter1": {
"type": "annotate_line_counter",
"lines": {
"<line_label>": {
"dir1_label": "entry",
"dir2_label": "exit",
"coords": [[<point1_x>, <point1_y>],[<point2_x>, <point2_y> ]],
"total_objects_crossed": <number>,
"total_objects_crossed_delta": <number>,
"dir1_objects_crossed": <number>,
"dir1_objects_crossed_delta": <number>,
"dir2_objects_crossed": <number>,
"dir2_objects_crossed_delta": <number>,
"cur_dir1_objects": [ <object_tracking_id>,<object_tracking_id> ],
"cur_dir2_objects": [ <object_tracking_id>,<object_tracking_id> ]
}
}
}
}
Format
Key | Type | Description |
---|---|---|
<line_label> | Array of dictionaries | Contains information about this specific line |
<line_label>.coords | Dictionary | Contains the coordinates for this linepoint1_x , point1_y : Coordinates of one endpointpoint2_x , point2_y : Coordinates of the other endpoint |
<line_label>.total_objects_crossed | Integer | Number of objects seen crossing this line since the start of the pipeline |
<line_label>.total_objects_crossed_delta | Integer | Number of objects seen crossing this line between last frame and this frame (both directions) |
<line_label>.dir1_objects_crossed | Integer | Number of objects seen crossing this line, in one direction since the start of the pipeline |
<line_label>.dir1_objects_crossed_delta | Integer | Number of objects seen crossing this line between last frame and this frame in the direction 1 |
<line_label>.dir2_objects_crossed | Integer | Number of objects seen crossing this line, in the other direction since the start of the pipeline |
<line_label>.dir2_objects_crossed_delta | Integer | Number of objects seen crossing this line between last frame and this frame in the direction 2 |
<roi_label>.cur_dir1_objects | List of object IDs | Information about the objects currently crossing the line in the first directionobject_tracking_id : Unique identifier for a specific object, as specified by object.id property (see AI Model Node ) |
<roi_label>.cur_dir2_objects | List of object IDs | Information about the objects currently crossing the line in the other directionobject_tracking_id : Unique identifier for a specific object, as specified by object.id property (see AI Model Node ) |
Updated about 2 months ago