FeatureTracker
FeatureTracker
如何放置它
Python
Python
1pipeline = dai.Pipeline()
2featureTracker = pipeline.create(dai.node.FeatureTracker)输入和输出
用法
Python
Python
1pipeline = dai.Pipeline()
2featureTracker = pipeline.create(dai.node.FeatureTracker)
3
4# 设置着色器和内存切片的最大数量
5featureTracker.setHardwareResources(2, 2)
6# 指定等待配置消息到达 inputConfig 输入。
7featureTracker.setWaitForConfigInput(True)
8
9# 您必须将 FeatureTracker 与
10# 图像帧源 - 单色/彩色摄像头或 xlinkIn 节点结合使用功能示例
图像单元格
目标特征计数 = 帧目标特征 / 单元格数量。 单元格的数量可以在水平和垂直方向上配置。默认单元格数量为 4(水平)x 4(垂直)。这意味着每个单元格的目标特征默认数量为: 320 / (4 * 4) = 20。请注意,如果一个已跟踪的点恰好在新坐标中位于一个 已满的单元格中,它不会被移除,因此特征数量可能会超过此限制。初始 Harris 阈值
新特征的进入条件
- 特征彼此之间不能太近(最小距离标准 - 默认值为 50,测量单位为像素平方欧氏距离),
- 特征的 Harris 分数足够高,
- 单元格中有足够的空间容纳该特征(未达到目标特征计数)。
已跟踪特征的 Harris 阈值
特征维护
- 跟踪错误过大(未正确跟踪),
- Harris 分数过低(可配置阈值)。
新位置计算
- 使用金字塔 Lucas-Kanade 光流法。
- 使用密集运动估计硬件块(块匹配器)。
参考
class
depthai.node.FeatureTracker(depthai.Node)
method
getWaitForConfigInput(self) -> bool: boolSee also: setWaitForConfigInput Returns: True if wait for inputConfig message, false otherwise
method
setHardwareResources(self, numShaves: typing.SupportsInt, numMemorySlices: typing.SupportsInt)Specify allocated hardware resources for feature tracking. 2 shaves/memory slices are required for optical flow, 1 for corner detection only. Parameter ``numShaves``: Number of shaves. Maximum 2. Parameter ``numMemorySlices``: Number of memory slices. Maximum 2.
method
setWaitForConfigInput(self, wait: bool)Specify whether or not wait until configuration message arrives to inputConfig Input. Parameter ``wait``: True to wait for configuration message, false otherwise.
property
initialConfig
Initial config to use for feature tracking.
property
inputConfig
Input FeatureTrackerConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
property
inputImage
Input message with frame data on which feature tracking is performed. Default queue is non-blocking with size 4.
property
outputFeatures
Outputs TrackedFeatures message that carries tracked features results.
property
passthroughInputImage
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。