如何放置
Python
Python
1with dai.Pipeline() as pipeline:
2 featureTracker = pipeline.create(dai.node.FeatureTracker)输入和输出
使用
Python
Python
1with dai.Pipeline() as pipeline:
2 featureTracker = pipeline.create(dai.node.FeatureTracker)
3
4 # 将shaves数量和memory slices数量设置为最大值
5 featureTracker.setHardwareResources(2, 2)
6 # 指定等待配置消息到达inputConfig输入
7 featureTracker.setWaitForConfigInput(True)
8
9 # 你必须将特征跟踪器与图像帧源(单色/彩色相机或xlinkIn节点)结合使用功能示例
工作原理
图像单元格
目标特征数 = 帧目标特征数 / 单元格数量。 单元格的数量可以在水平和垂直方向上配置。默认单元格数为4(水平)×4(垂直)。这意味着每个单元格的默认目标特征数为: 320 / (4 * 4) = 20。注意,如果已跟踪的点的新坐标位于已满的单元格中,该点不会被移除,因此特征数可能超过此限制。初始Harris阈值
新特征的进入条件
- 特征之间不能太近(最小距离标准——默认值为50,测量单位为像素的平方欧几里得距离),
- 特征的Harris分数足够高,
- 单元格中有足够的空间容纳该特征(未达到目标特征数)。
已跟踪特征的Harris阈值
特征维护
- 跟踪误差过大(未被正确跟踪),
- Harris分数过小(可配置阈值)。
新位置计算
- 使用金字塔Lucas-Kanade光流方法。
- 使用密集运动估计硬件块(块匹配器)。
参考
class
dai::node::FeatureTracker
variable
std::shared_ptr< FeatureTrackerConfig > initialConfig
Initial config to use for feature tracking.
variable
Input inputConfig
Input FeatureTrackerConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input message with frame data on which feature tracking is performed. Default queue is non-blocking with size 4.
variable
Output outputFeatures
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
FeatureTracker()function
FeatureTracker(std::unique_ptr< Properties > props)function
void setHardwareResources(int numShaves, int numMemorySlices)Specify allocated hardware resources for feature tracking. 2 shaves/memory slices are required for optical flow, 1 for corner detection only.
Parameters
- numShaves: Number of shaves. Maximum 2.
- numMemorySlices: Number of memory slices. Maximum 2.
inline function
DeviceNodeCRTP()inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。