Public Member Functions | Public Attributes | Static Public Attributes | List of all members
dai::node::ObjectTracker Class Reference

ObjectTracker node. Performs object tracking using Kalman filter and hungarian algorithm. More...

#include <ObjectTracker.hpp>

Inheritance diagram for dai::node::ObjectTracker:
Inheritance graph
[legend]

Public Member Functions

 ObjectTracker (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
 
 ObjectTracker (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId, std::unique_ptr< Properties > props)
 
void setDetectionLabelsToTrack (std::vector< std::uint32_t > labels)
 
void setMaxObjectsToTrack (std::int32_t maxObjectsToTrack)
 
void setTrackerIdAssignmentPolicy (TrackerIdAssignmentPolicy type)
 
void setTrackerThreshold (float threshold)
 
void setTrackerType (TrackerType type)
 
void setTrackingPerClass (bool trackingPerClass)
 
- Public Member Functions inherited from dai::NodeCRTP< Node, ObjectTracker, ObjectTrackerProperties >
std::unique_ptr< Nodeclone () const override
 
const char * getName () const override
 
- Public Member Functions inherited from dai::Node
virtual std::unique_ptr< Nodeclone () const =0
 Deep copy the node. More...
 
AssetManagergetAssetManager ()
 Get node AssetManager as a reference. More...
 
const AssetManagergetAssetManager () const
 Get node AssetManager as a const reference. More...
 
std::vector< Input * > getInputRefs ()
 Retrieves reference to node inputs. More...
 
std::vector< const Input * > getInputRefs () const
 Retrieves reference to node inputs. More...
 
std::vector< InputgetInputs ()
 Retrieves all nodes inputs. More...
 
virtual const char * getName () const =0
 Retrieves nodes name. More...
 
std::vector< Output * > getOutputRefs ()
 Retrieves reference to node outputs. More...
 
std::vector< const Output * > getOutputRefs () const
 Retrieves reference to node outputs. More...
 
std::vector< OutputgetOutputs ()
 Retrieves all nodes outputs. More...
 
Pipeline getParentPipeline ()
 
const Pipeline getParentPipeline () const
 
 Node (const std::shared_ptr< PipelineImpl > &p, Id nodeId, std::unique_ptr< Properties > props)
 Constructs Node. More...
 
virtual ~Node ()=default
 

Public Attributes

Input inputDetectionFrame {*this, "inputDetectionFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}
 
Input inputDetections {*this, "inputDetections", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgDetections, true}}}
 
Input inputTrackerFrame {*this, "inputTrackerFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}
 
Output out {*this, "out", Output::Type::MSender, {{DatatypeEnum::Tracklets, false}}}
 
Output passthroughDetectionFrame {*this, "passthroughDetectionFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}
 
Output passthroughDetections {*this, "passthroughDetections", Output::Type::MSender, {{DatatypeEnum::ImgDetections, true}}}
 
Output passthroughTrackerFrame {*this, "passthroughTrackerFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}
 
- Public Attributes inherited from dai::NodeCRTP< Node, ObjectTracker, ObjectTrackerProperties >
Propertiesproperties
 Underlying properties. More...
 
- Public Attributes inherited from dai::Node
const Id id
 Id of node. More...
 
Propertiesproperties
 

Static Public Attributes

constexpr static const char * NAME = "ObjectTracker"
 

Additional Inherited Members

- Public Types inherited from dai::NodeCRTP< Node, ObjectTracker, ObjectTrackerProperties >
using Properties = ObjectTrackerProperties
 
- Public Types inherited from dai::Node
using Id = std::int64_t
 Node identificator. Unique for every node on a single Pipeline. More...
 
- Protected Member Functions inherited from dai::Node
virtual PropertiesgetProperties ()
 
virtual tl::optional< OpenVINO::VersiongetRequiredOpenVINOVersion ()
 
void setInputMapRefs (InputMap *inMapRef)
 
void setInputMapRefs (std::initializer_list< InputMap * > l)
 
void setInputRefs (Input *inRef)
 
void setInputRefs (std::initializer_list< Input * > l)
 
void setOutputMapRefs (OutputMap *outMapRef)
 
void setOutputMapRefs (std::initializer_list< OutputMap * > l)
 
void setOutputRefs (Output *outRef)
 
void setOutputRefs (std::initializer_list< Output * > l)
 
- Protected Attributes inherited from dai::Node
AssetManager assetManager
 
std::unordered_map< std::string, InputMap * > inputMapRefs
 
std::unordered_map< std::string, Input * > inputRefs
 
std::unordered_map< std::string, OutputMap * > outputMapRefs
 
std::unordered_map< std::string, Output * > outputRefs
 
std::weak_ptr< PipelineImplparent
 
copyable_unique_ptr< PropertiespropertiesHolder
 

Detailed Description

ObjectTracker node. Performs object tracking using Kalman filter and hungarian algorithm.

Definition at line 19 of file ObjectTracker.hpp.

Constructor & Destructor Documentation

◆ ObjectTracker() [1/2]

dai::node::ObjectTracker::ObjectTracker ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId 
)

Definition at line 8 of file ObjectTracker.cpp.

◆ ObjectTracker() [2/2]

dai::node::ObjectTracker::ObjectTracker ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId,
std::unique_ptr< Properties props 
)

Definition at line 10 of file ObjectTracker.cpp.

Member Function Documentation

◆ setDetectionLabelsToTrack()

void dai::node::ObjectTracker::setDetectionLabelsToTrack ( std::vector< std::uint32_t >  labels)

Specify detection labels to track.

Parameters
labelsDetection labels to track. Default every label is tracked from image detection network output.

Definition at line 24 of file ObjectTracker.cpp.

◆ setMaxObjectsToTrack()

void dai::node::ObjectTracker::setMaxObjectsToTrack ( std::int32_t  maxObjectsToTrack)

Specify maximum number of object to track.

Parameters
maxObjectsToTrackMaximum number of object to track. Maximum 60 in case of SHORT_TERM_KCF, otherwise 1000.

Definition at line 20 of file ObjectTracker.cpp.

◆ setTrackerIdAssignmentPolicy()

void dai::node::ObjectTracker::setTrackerIdAssignmentPolicy ( TrackerIdAssignmentPolicy  type)

Specify tracker ID assignment policy.

Parameters
typeTracker ID assignment policy.

Definition at line 32 of file ObjectTracker.cpp.

◆ setTrackerThreshold()

void dai::node::ObjectTracker::setTrackerThreshold ( float  threshold)

Specify tracker threshold.

Parameters
thresholdAbove this threshold the detected objects will be tracked. Default 0, all image detections are tracked.

Definition at line 16 of file ObjectTracker.cpp.

◆ setTrackerType()

void dai::node::ObjectTracker::setTrackerType ( TrackerType  type)

Specify tracker type algorithm.

Parameters
typeTracker type.

Definition at line 28 of file ObjectTracker.cpp.

◆ setTrackingPerClass()

void dai::node::ObjectTracker::setTrackingPerClass ( bool  trackingPerClass)

Whether tracker should take into consideration class label for tracking.

Definition at line 35 of file ObjectTracker.cpp.

Member Data Documentation

◆ inputDetectionFrame

Input dai::node::ObjectTracker::inputDetectionFrame {*this, "inputDetectionFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}

Input ImgFrame message on which object detection was performed. Default queue is non-blocking with size 4.

Definition at line 36 of file ObjectTracker.hpp.

◆ inputDetections

Input dai::node::ObjectTracker::inputDetections {*this, "inputDetections", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgDetections, true}}}

Input message with image detection from neural network. Default queue is non-blocking with size 4.

Definition at line 42 of file ObjectTracker.hpp.

◆ inputTrackerFrame

Input dai::node::ObjectTracker::inputTrackerFrame {*this, "inputTrackerFrame", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}

Input ImgFrame message on which tracking will be performed. RGBp, BGRp, NV12, YUV420p types are supported. Default queue is non-blocking with size 4.

Definition at line 30 of file ObjectTracker.hpp.

◆ NAME

constexpr static const char* dai::node::ObjectTracker::NAME = "ObjectTracker"
staticconstexpr

Definition at line 21 of file ObjectTracker.hpp.

◆ out

Output dai::node::ObjectTracker::out {*this, "out", Output::Type::MSender, {{DatatypeEnum::Tracklets, false}}}

Outputs Tracklets message that carries object tracking results.

Definition at line 47 of file ObjectTracker.hpp.

◆ passthroughDetectionFrame

Output dai::node::ObjectTracker::passthroughDetectionFrame {*this, "passthroughDetectionFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Passthrough ImgFrame message on which object detection was performed. Suitable for when input queue is set to non-blocking behavior.

Definition at line 59 of file ObjectTracker.hpp.

◆ passthroughDetections

Output dai::node::ObjectTracker::passthroughDetections {*this, "passthroughDetections", Output::Type::MSender, {{DatatypeEnum::ImgDetections, true}}}

Passthrough image detections message from neural network output. Suitable for when input queue is set to non-blocking behavior.

Definition at line 65 of file ObjectTracker.hpp.

◆ passthroughTrackerFrame

Output dai::node::ObjectTracker::passthroughTrackerFrame {*this, "passthroughTrackerFrame", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Passthrough ImgFrame message on which tracking was performed. Suitable for when input queue is set to non-blocking behavior.

Definition at line 53 of file ObjectTracker.hpp.


The documentation for this class was generated from the following files:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20