Class ObjectTracker

Inheritance Relationships

Base Types

Class Documentation

class ObjectTracker : public dai::DeviceNodeCRTP<DeviceNode, ObjectTracker, ObjectTrackerProperties>, public dai::HostRunnable

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

Public Functions

void setTrackerThreshold(float threshold)

Specify tracker threshold.

Parameters:

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

void setMaxObjectsToTrack(std::int32_t maxObjectsToTrack)

Specify maximum number of object to track.

Parameters:

maxObjectsToTrack – Maximum number of object to track. Maximum 60 in case of SHORT_TERM_KCF, otherwise 1000.

void setDetectionLabelsToTrack(std::vector<std::uint32_t> labels)

Specify detection labels to track.

Parameters:

labels – Detection labels to track. Default every label is tracked from image detection network output.

void setTrackerType(TrackerType type)

Specify tracker type algorithm.

Parameters:

type – Tracker type.

void setTrackerIdAssignmentPolicy(TrackerIdAssignmentPolicy type)

Specify tracker ID assignment policy.

Parameters:

type – Tracker ID assignment policy.

void setTrackingPerClass(bool trackingPerClass)

Whether tracker should take into consideration class label for tracking.

void setOcclusionRatioThreshold(float theshold)

Set the occlusion ratio threshold. Used to filter out overlapping tracklets.

Parameters:

theshold – Occlusion ratio threshold. Default 0.3.

void setTrackletMaxLifespan(uint32_t trackletMaxLifespan)

Set the tracklet lifespan in number of frames. Number of frames after which a LOST tracklet is removed.

Parameters:

trackletMaxLifespanTracklet lifespan in number of frames. Default 120.

void setTrackletBirthThreshold(uint32_t trackletBirthThreshold)

Set the tracklet birth threshold. Minimum consecutive tracked frames required to consider a tracklet as a new (TRACKED) instance.

Parameters:

trackletBirthThresholdTracklet birth threshold. Default 3.

void setRunOnHost(bool runOnHost)

Specify whether to run on host or device By default, the node will run on device.

virtual bool runOnHost() const override

Check if the node is set to run on host

virtual void run() override
inline DeviceNodeCRTP()
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props, bool confMode)
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device, std::unique_ptr<Properties> props, bool confMode)

Public Members

Input inputTrackerFrame = {*this, {"inputTrackerFrame", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::ImgFrame, false}}}, true}}

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

Input inputDetectionFrame = {*this, {"inputDetectionFrame", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::ImgFrame, false}}}, true}}

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

Input inputDetections = {*this, {"inputDetections", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::ImgDetections, true}}}, true}}

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

Input inputConfig = {*this, {"inputConfig", DEFAULT_GROUP, false, 4, {{DatatypeEnum::ObjectTrackerConfig, false}}}, true}

Input ObjectTrackerConfig message with ability to modify parameters at runtime. Default queue is non-blocking with size 4.

Output out = {*this, {"out", DEFAULT_GROUP, {{{DatatypeEnum::Tracklets, false}}}}}

Outputs Tracklets message that carries object tracking results.

Output passthroughTrackerFrame = {*this, {"passthroughTrackerFrame", DEFAULT_GROUP, {{{DatatypeEnum::ImgFrame, false}}}}}

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

Output passthroughDetectionFrame = {*this, {"passthroughDetectionFrame", DEFAULT_GROUP, {{{DatatypeEnum::ImgFrame, false}}}}}

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

Output passthroughDetections = {*this, {"passthroughDetections", DEFAULT_GROUP, {{{DatatypeEnum::ImgDetections, true}}}}}

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

Public Static Attributes

static constexpr const char *NAME = "ObjectTracker"