文章标题

关于光流实现方法的总结
关于论文
A Survey of Optical Flow Techniques for Robotics Navigation Applications

一些算法:

  • gradient based approaches
    基于梯度的方法,如Lucas-Kanade
    和Horn-Shunck methods
  • feature based methods
    基于特征的方法,如SIFT方法
  • interpolation techniques
    插值法

详细介绍:

  • Lucas-Kanade方法
    Lucas-Kanade method, which is one of the
    differential methods for optical flow computation with local energy optimization [36].The differential methods compute optical flow from spatiotemporal derivatives of image intensity or filtered image [4]. Lucas-Kanade
    algorithm is robust to image noise, but may
    not generate dense flows [4];

  • Horn-Schunck方法
    Horn-Schunck method, which is also a differential method but with global energy minimization[25]. This method is more sensitive to noise, but can generate dense flow fields [4];

  • Image interpolation方法
    Image interpolation method, which is developed by Srinivasan specially for low-computation applications such as small UAVs [48]. This method does not need tracking of features or calculation of image velocity at different locations [58];

  • Block matching 算法
    Block matching algorithm, which include
    methods to minimize the sum of squared differences (SSD) or the sum of absolute difference (SAD). SAD block matching method has been incorporated with inertial measurements for accurate estimation of optical flow on small UAVs [30];

  • Feature-based 的方法
    Feature-based methods, features can be used
    instead of the raw intensity values for the computation of optical flow. Feature extraction algorithms such as Scale Invariant Feature Transform (SIFT) can be used to detect features. The detected features are then further correlated into pixel movements representingoptical flow [35].

其中我觉的比较有意思的有:

  • ETHZ的PX4Flow
    基于SAD block matching 算法,他们的比较有参考性的论文有流传已久的“px4flow_paper”,也就是”An open source and open hardware embedded metric optical flow cmos camera for indoor and outdoor app“,2013年的ICRA

  • 日本的一个用 OV7740+FPGA 实现的光流,还有做Phenox的团队之前发的一些文章,都是利用FPGA+MCU的结构实现光流和飞行器的控制。

  • CentEye专用的硬件,非常的轻,并且已经用到过Crazyflie上面了。

插入一点对px4flow程序的分析

原链接2016.2.27 Px4 flow分析

主要来分析最后一个函数compute flow

原版代码的光流算法主要是使用hist直方图算法,这段代码主要可以分成两部分来看,第一部分是生成直方图,第二部分是根据直方图来进行位移向量的计算。由于是光流,那么就是飞机底部的摄像头随时间移动的一个趋势,那么一定是需要至少两幅图的数据,分别为frame1和frame2 。

第一步的j、i的for循环是采样点的循环,之中的jj、ii的循环是对于一个小邻域的采样。采样点是从frame1找的,之后根据采样点的坐标在frame2的-winmin到winmin的一个小矩形种找一个最相似的点,简单来说,就是找到采样点在两幅图的对应位置。

PARAM_BOTTOM_FLOW_FEATURE_THRESHOLD变量来判断对于特征点采样的质量要求,越大越严苛。表示是否当前这个点可以作为计算光流的点。原函数计算了梯度等。

之后找第二张图中一个最相似的点,计算sad(sum of absolute difference)也就是对于两张图的差异的绝对值的和进行计算,然后作为相似度的衡量,越小越相似。PARAM_BOTTOM_FLOW_VALUE_THRESHOLD则是对于相似度的一个阈值判断,越小越相似,越大越严苛,如果不满足这个条件,说明两张图片几乎找不到对应点,那么就没戏了,接着看下一个采样点吧。

如果很幸运,frame1中找到了可以计算的采样点,而且在frame2中也找到了对应的点,那么可以计算x和y方向的差值,或者说是一个移动向量,分别计算x和y两个方向的移动,这样就能够获得移动的向量,其中两个方向x和y移动的多少则记录在一个直方图的数组中。

所以最终x和y的直方图数组中记录的是所有挑战过两关的英雄点,记录移动的大小和方向。

以上是对于hist的产生,除了hist之外还有个东西,是对应点的移动的数据,也就是所有采样点的移动的方向和大小,dirs和subdirs,dirs记录的是像素级别的移动,subdirs记录的是亚像素级,也就是半个像素点的移动。

有了hist和dirs,那么用hist和dirs的数据代表原来的数据,就不用frame1和frame2了,可以光荣退役了,因为有了更能表示的一种方式——直方图和方向向量。

第一步是一个小参数的判断,是否filter,这个感觉影响不大,效果都差不多,不知道其他人是不是这样。

如果是PARAM_BOTTOM_FLOW_HIST_FILTER,那么就是对于hist的处理,如果不是,那么就是对于dirs和subdirs的计算,比较简单,简简单单的求和然后处以有效的采样点个数就可以了。

最后融合gyro的信息进行调整。

                                                                  G106group BUAASCSE

flow.c源代码:

https://github.com/PX4/Flow/blob/master/src/modules/flow/flow.c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值