ObjectTracker
最后更新
如何放置它
Python
Python
1pipeline = dai.Pipeline()
2objectTracker = pipeline.create(dai.node.ObjectTracker)输入和输出
零项跟踪
短期跟踪
支持的对象跟踪器类型
SHORT_TERM_KCF:核相关滤波器跟踪。KCF 利用循环矩阵的特性来提高处理速度。论文 此处。SHORT_TERM_IMAGELESS:短期跟踪允许在跳过对象检测的帧上跟踪对象,通过从先前的检测中推断对象轨迹。ZERO_TERM_COLOR_HISTOGRAM:利用位置、形状和输入图像信息(如 RGB 直方图)执行对象跟踪。ZERO_TERM_IMAGELESS:仅利用检测对象的矩形形状和位置信息进行对象跟踪。它不使用跟踪对象的颜色信息。它比 ZERO_TERM_COLOR_HISTOGRAM 具有更高的吞吐量。用户在选择对象跟踪器类型时需要权衡吞吐量和准确性。
最大跟踪对象数
用法
Python
Python
1pipeline = dai.Pipeline()
2objectTracker = pipeline.create(dai.node.ObjectTracker)
3
4objectTracker.setDetectionLabelsToTrack([15]) # 仅跟踪人
5# 可能的跟踪类型:ZERO_TERM_COLOR_HISTOGRAM, ZERO_TERM_IMAGELESS, SHORT_TERM_IMAGELESS, SHORT_TERM_KCF
6objectTracker.setTrackerType(dai.TrackerType.ZERO_TERM_COLOR_HISTOGRAM)
7# 当跟踪新对象时,取最小的 ID,可能的选项:SMALLEST_ID, UNIQUE_ID
8objectTracker.setTrackerIdAssignmentPolicy(dai.TrackerIdAssignmentPolicy.SMALLEST_ID)
9
10# 您必须将对象跟踪器与检测网络
11# 和图像帧源(单色/彩色相机或 xlinkIn 节点)结合使用功能示例
参考
class
depthai.node.ObjectTracker(depthai.Node)
method
setDetectionLabelsToTrack(self, labels: collections.abc.Sequence
[
typing.SupportsInt
])Specify detection labels to track. Parameter ``labels``: Detection labels to track. Default every label is tracked from image detection network output.
method
setMaxObjectsToTrack(self, maxObjectsToTrack: typing.SupportsInt)Specify maximum number of object to track. Parameter ``maxObjectsToTrack``: Maximum number of object to track. Maximum 60 in case of SHORT_TERM_KCF, otherwise 1000.
method
setOcclusionRatioThreshold(self, occlusionRatioThreshold: typing.SupportsFloat)Specify occlusion ratio threshold. Parameter ``occlusionRatioThreshold``: Occlusion ratio threshold. Used to filter out overlapping tracklets. Default 0.4.
method
setTrackerIdAssignmentPolicy(self, type: depthai.TrackerIdAssignmentPolicy)Specify tracker ID assignment policy. Parameter ``type``: Tracker ID assignment policy.
method
setTrackerThreshold(self, threshold: typing.SupportsFloat)Specify tracker threshold. Parameter ``threshold``: Above this threshold the detected objects will be tracked. Default 0, all image detections are tracked.
method
setTrackerType(self, type: depthai.TrackerType)Specify tracker type algorithm. Parameter ``type``: Tracker type.
method
setTrackingPerClass(self, trackingPerClass: bool)Whether tracker should take into consideration class label for tracking.
method
setTrackletBirthThreshold(self, threshold: typing.SupportsInt)Specify tracklet birth threshold. Parameter ``threshold``: Tracklet birth threshold. Minimum consecutive tracked frames required to consider a tracklet as a new instance. Default 3.
method
setTrackletMaxLifespan(self, lifespan: typing.SupportsInt)Specify tracklet lifespan. Parameter ``lifespan``: Tracklet lifespan in number of frames. Number of frames after which a LOST tracklet is removed. Default 120.
property
inputConfig
Input ObjectTrackerConfig message with ability to modify parameters at runtime. Default queue is non-blocking with size 4.
property
inputDetectionFrame
Input ImgFrame message on which object detection was performed. Default queue is non-blocking with size 4.
property
inputDetections
Input message with image detection from neural network. Default queue is non- blocking with size 4.
property
inputTrackerFrame
Input ImgFrame message on which tracking will be performed. RGBp, BGRp, NV12, YUV420p types are supported. Default queue is non-blocking with size 4.
property
out
Outputs Tracklets message that carries object tracking results.
property
passthroughDetectionFrame
Passthrough ImgFrame message on which object detection was performed. Suitable for when input queue is set to non-blocking behavior.
property
passthroughDetections
Passthrough image detections message from neural network output. Suitable for when input queue is set to non-blocking behavior.
property
passthroughTrackerFrame
Passthrough ImgFrame message on which tracking was performed. Suitable for when input queue is set to non-blocking behavior.
需要帮助?
请访问讨论论坛以获取技术支持或您可能有的任何其他问题。