Filter Objects

Filter objects based on their presence within or outside a Region of interest.

Overview

This node can be used if you want to remove objects to process on downstream pipeline nodes based on their current position on image.

Requires a AI Model Node before it in order to function properly. Having a Track Objects Node before is optional, but it's required to get proper results on filtered_object_entered_delta and filtered_object_exited_delta metadata fields.

Inputs & Outputs

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

Properties

PropertyDescriptionTypeDefaultRequired
filter_modeFilter mode. Options: Retain if within ROI (include_within_roi); Retain if outside ROI (include_outside_roi); Retain if new or updated (new_or_updated_objects); Retain if matches a pattern (pattern_matched_objects); Retain if outside other object (include_outside_object); Retain if within other object (include_inside_object); Retain if contains other object (include_contains_object); Retain if does not contain other object (include_not_contains_object).enuminclude_within_roiNo
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
source_node_idIf specified, only process objects generated by the specified source node. Removes objects from other nodes. Accepted node type: model_inference.stringnullNo
objects_to_trackex. car,person,car.red. Object types to process. Objects that are not specified will be removed/kept depending on Object processing mode. Leave blank to process all.model-labelsnullNo
object_min_thresholdRetain objects which have confidence above this threshold. Range: minimum 0, maximum 1.0. Step: 0.1.floatnullNo
object_max_thresholdRetain objects which have confidence below this threshold. Range: minimum 0, maximum 1.0. Step: 0.1.floatnullNo
object_min_sizeRetain objects which have height and width greater than this value in pixels. Range: minimum 0, maximum 1920. Step: 16. Unit: pixels.integernullNo
object_id_patternRetain objects with IDs specified in the pattern. Conditional on filter_mode being pattern_matched_objects.stringnullNo
other_object_typesex. car,person,car.red. Retain objects within/outside/contain/not contain these object types. Only applies when filter mode is include_inside_object, include_outside_object, include_contains_object or include_not_contains_object.model-labelsnullNo
display_roiDisplay ROI on video?boolfalseNo
display_objectsDisplay removed objects on video?boolfalseNo
display_retained_objectsDisplay retained objects on video?boolfalseNo
object_processing_modeRemove or keep objects other than specified types to process. Options: Remove non-specified (remove_non_specified_objects): Remove objects other than specified Object types to process; Keep non-specified (keep_non_specified_objects): Keep objects other than specified Object types to process.enumremove_non_specified_objectsNo
tracking_modeObject tracking mode. Options: Centroid (centroid); Top center (top-center); Bottom center (bottom-center); Left center (left-center); Right center (right-center).enumcentroidNo
object_contain_modeObject containment mode. Options: Bounding Box (bbox): Bounding box inside other object's bounding box; Tracking Point (centroid): Selected tracking point (above) inside other object's bounding box.enumcentroidNo

Output Metadata

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

PathTypeDescription
nodes.<node_id>.filtered_object_countintegerCurrent total number of removed objects
nodes.<node_id>.filtered_object_entered_deltaintegerNumber of objects that entered the filtered_objects list between last frame and the current frame. Note: Requires an upstream Track Objects Node. Else this property will be set to 0.
nodes.<node_id>.filtered_object_exited_deltaintegerNumber of objects that left the filtered_objects list between last frame and the current frame. Note: Requires an upstream Track Objects Node. Else this property will be set to 0.
nodes.<node_id>.retained_object_countintegerCurrent total number of retained objects
nodes.<node_id>.retained_object_added_deltaintegerNumber of objects that were added to the retain list between last frame and the current frame. Note: Requires an upstream Track Objects Node. Else this property will be set to 0.
nodes.<node_id>.retained_object_removed_deltaintegerNumber of objects that were removed from the retain list between last frame and the current frame. Note: Requires an upstream Track Objects Node. Else this property will be set to 0.
nodes.<node_id>.filtered_objectsarrayArray of tracking IDs of objects removed by the configured filters.
nodes.<node_id>.typestringIdentifies the node type that produced this metadata.

JSON example

{
  "nodes": {
    "filter_objects1": {
      "filtered_object_count": 0,
      "filtered_object_entered_delta": 0,
      "filtered_object_exited_delta": 0,
      "filtered_objects": [],
      "retained_object_added_delta": 0,
      "retained_object_count": 0,
      "retained_object_removed_delta": 0,
      "type": "filter_objects"
    }
  }
}

Did this page help you?