特征跟踪器
如何放置
Python
Python
1pipeline = dai.Pipeline()
2featureTracker = pipeline.create(dai.node.FeatureTracker)输入与输出
使用方法
Python
Python
1pipeline = dai.Pipeline()
2featureTracker = pipeline.create(dai.node.FeatureTracker)
3
4# 设置SHAVE数量和内存切片数量为最大值
5featureTracker.setHardwareResources(2, 2)
6# 指定等待配置消息到达inputConfig输入
7featureTracker.setWaitForConfigInput(True)
8
9# 必须将特征跟踪器与图像帧源(单目/彩色相机或XLinkIn节点)结合使用功能示例
图像网格
目标特征数量 = 帧目标特征数 / 网格总数。 网格数量可在水平和垂直方向上配置。默认网格数量为 4(水平)× 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.
需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。