首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

基于Zynq的光流法软硬件协同设计与实现--前言

基于Zynq的光流法软硬件协同设计与实现--前言

1. 前言
光流场(Optical Flow Field)[1]是指图像中所有像素点构成的一种二维(2D)瞬时速度场,其中的二维速度矢量是景物中可见点的三维速度矢量在成像表面的投影。通过光流场计算能够在相机运动以及不知道场景信息的情况下检测出运动对象。因此光流场计算方法(即光流法)在模式识别、计算机视觉以及图像处理等领域具有极其重要的基础地位。基于光流可以实现在军事航天、交通监管、信息科学、气象、医学等多个领域的重要应用。例如利用光流场可以非常有效的对图像目标进行检测和分割,这对地对空导弹火控系统的精确制导,自动飞行器精确导航与着陆,战场的动态分析,军事侦察的航天或卫星图片的自动分析系统,医学上异常器官细胞的分析与诊断系统,气象中对云图的运动分析,城市交通的车流量进行监管都具有重要价值。

光流在是由于场景中前景目标本身的移动、相机的运动,或者两者的共同运动所产生的。对光流算法的研究,真正提出有效光流计算方法还归功于Horn和Schunck [5]在1981年创造性地将二维速度场与灰度相联系,引入光流约束方程的算法,是光流算法发展的基石。在此基础上出现了大量的方法来解决这一问题:变分光流法,如Combing-Brightness-Gradient [6]、Combing-Local-Global [7];局部差分法,如Lucas-Kanade [2]、Farneback [10]; 基于特征的方法,如Wills [11]; 基于匹配的方法,如Anandan [12];基于频域的方法,如Heeger [13]; 以及基于相位的光流法:Fleet [14]。其中,变分光流法以其透明建模、旋转的不变性、稠密光流场和高质量光流场 [8] [9]成为了光流计算的首选。下面以变分光流法为主线,从计算效果和计算性能两个方面来阐述。
在研究提高光流场计算效果的过程中,Horn和Schunck [5]根据同一个运动物体的光流场具有连续、平滑的特点, 提出一个附加约束条件,将光流场的整体平滑约束转换为一个变分的问题;为了处理分段平滑的和不连续的光流场,Enkelmann [12]在Horn和Schunck的模型上引入了二次的平滑项约束; Weickert和Schnorr [15]在平滑项上引入了鲁棒性的非二次的平滑项约束以减少外部影响;同样地,在也有了非二次的数据项约束;在光照不均衡的情况下,灰度守恒不能很好的计算光流,为此Brox等人 [7]提出了梯度守恒。Lucas-Kanade [2]局部光流法的鲁棒性更好,而全局光流法计算出的是稠密光流法,因此,Bruhn等人 [7]提出了CLG的光流能量模型;为了处理较大位移的运动模型,Brox等人[8] [16]引入了一种非线性的能量守恒的能量方程。
在研究提升光流场计算性能的过程中,Black和Anandan [17]提出了由粗到精的金字塔多级结构的计算方法;Bruhn和Weickert [18]提出了多尺度的解决方法;Gwosdek [19]提出了一种线性的多尺度红黑超松弛计算方法。随着CUDA技术的发展,基于GPU的光流计算系统 [20]也受到了更多关注。由于细粒度并行支持、硬件的可重构特性及更适合嵌入式系统中实现等原因,基于FPGA的光流系统 [21] [22] [23]的高性能实现受到了最多的关注。
目前,限制光流法广泛应用的最大难题在于计算耗时,实时性差。比如常用的KLT光流法[2][3],当要处理的图像分辨率为1024*768,特征点数为1000时,在主频3GHz的P4处理器下每秒钟只能处理约2-3帧图像[4]。而稠密光流法[5][6][7],其因需要上千次迭代才能得到最优解,在现有的硬件架构下,计算相当耗时,几秒钟甚至更长时间才能处理完一幅图像,显然远远无法满足实时处理的需要。随着异构芯片的发展,Chun [24]等人认为异构芯片有优势打破传统硬件单一体系结构的局限,因此,这为光流场的实时计算提供了可能。Xilinx [25]在2012年率先推出了基于Zynq-7000的体系结构的异构芯片,集成了ARM和FPGA到一块芯片。Zynq-7000 系列器件将处理器的软件可编程能力与 FPGA 的硬件可编程能力实现完美结合,以低功耗和低成本等系统优势实现无以伦比的系统性能、灵活性、可扩展性。
本项目通过分析与研究变分光流法计算效率、硬件加速方法及最佳软硬件协作方式,在Zedboard实现上对光流场的实时计算。其中变分光流法的模型是基于Horn-Schunck [5]。如图1所示,项目实现的基本流程是:1) 先对光流算法的基本理论进行分析,包括算法的工作流程、计算复杂性、可并行性和软硬件模块的划分。2)关键接口层实现,特别是ARM与FPGA之间大数据通信的并行访问机制、高级语言对硬件结构化的描述。 3)系统设计接口层实现,比如ARM控制FPGA的IP核的初始化、配置和启动,以及软硬件协同的设计,最终基准数据测试。


参考文献
[1] http://en.wikipedia.org/wiki/Optical_flow.
[2] Bruce D. Lucas and Takeo Kanade, An iterative image registration technique with an application to stereo vision, Proceedings of Imaging Understanding Workshop, 1981, pp. 121-130.
[3] Jianbo Shi and Carlo Tomasi, Good features to track, IEEE Conference on Computer Vision and Pattern Recognition, (CVPR 1994), pp. 593-600.
[4] M. P. Sudipta, N. Sinha, Jan-Michael Frahm and Y. Genc, Feature tracking and matching in video using programmable graphics hardware, Machine Vision and Applications, 2007, vol. 30, pp. 185-198.
[5] Berthold K.P. Horn and Brian G. Schunck, Determining optical flow, Artificial Intelligence (AI 1981), Volume 17, Issues 1-3, pp. 185-203.
[6] T. Brox, A. Bruhn, N. Papenberg, and J. Weickert, High accuracy optical flow estimation based on a theory for warping, 8th European Conference on Computer Vision (ECCV 2004), pp. 25-36.
[7] A. Bruhn, J. Weickert, and C. Schnorr, Lucas/kanade meets horn/schunck: Combining local and global optic flow methods, International Journal of Computer Vision (IJCV 2005), 61:3, pp. 211–231.
[8] J.L. Barron, D.J. Fleet, S.S. Beauchemin, Performance of optical flow Techniques, International Journal of Computer Vision (IJCV 1994), 12:1, pp.43-77.
[9] S. Baker, D. Scharstein, J. Lewis, S. Roth, M. J. Black, and R. Szeliski, A database and evaluation methodology for optical flow. International Journal of Computer Vision (IJCV 2011) 92, 1–31.
[10] G. Farneback. Very high accuracy velocity estimation using orientation tensors, parametric motion, and simultaneous segmentation of the motion field. In Proc. Eighth International Conference on Computer Vision (ICCV 2001), volume 1, pp.171–177.
[11] J. Wills, S. Agarwal, and S. Belongie. A feature-based approach for dense segmentation and estimation of large disparity motion. International Journal of Computer Vision (IJCV 2006), 68:2, pp.125–143.
[12] Anandan P, A computational framework and an algorithm for the measurement of visual motion, International Journal of Computer Vision (IJCV 1989) 2, pp. 283-310.
[13] Heeger D.J, Optical flow using spatiotemporal filters, International Journal of Computer Vision (IJCV 1990) 1, pp. 279-302.
[14] Fleet D.J. and Jepson A.D, Computation of component image velocity from local phase information, International Journal of Computer Vision (IJCV 1990), Vision 5, pp. 77-104.
[15] J. Weickert and C. Schnorr,CHNORR, A theoretical framework for convex regularizers in pde-based computation of image motion. International Journal of Computer Vision (IJCV 2001), 45: 3, pp. 245–264.
[16] Thomas Brox, Jitendra Malik, large displacement optical flow: descriptor matching in variational motion estimation, IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI 2011), pp. 500 - 513.
[17] M. J. Black and P. Anandan, The robust estimation of multiple motions: Parametric and piecewise smooth flow fields, Computer Vision and Image Understanding (CVIU 1996), 63:1, pp. 45–104.
[18] A. Bruhn and J. Weickert, A multigrid platform for real-time motion computation with discontinuity-preserving variational methods, International Journal of Computer Vision(IJCV 2006), 70, pp. 257–277.
[19] P. Gwosdek, A. Bruhn, and J. Weickert, Variational optic flow on the sony playstation 3. Real Time Image Proc ( RTIP 2010), 5.
[20] H. Grossauer and P. Thoman, Gpu-based multi-grid:real-time performance in high resolution nonlinear image processing. International Conference on Computer Vision System (ICVS 2008), pp.141–150.
[21] Zhilei Chai, Jianbo Shi, Improving KLT in embedded systems by processing oversampling video sequence in real-time, 5th International Conference on Reconfigurable Computing and FPGAs (Reconfig2011), pp. 297-302.
[22] J. L. Martin, A. Zuloaga, C. Cuadrado, J. Lazaro and U. Bidarte, Hardware implementation of optical flow constraint equation using FPGAs, Computer Vision and Image Understanding (CVIU 2005), pp. 462-490.
[23] R. Rustam, N. H. Hamid and F. A. Hussin, FPGA-based Hardware Implementation of Optical Flow Constraint Equation of Horn and Schunck, 2012 4th International Conference on Intelligent and Advanced Systems (ICIAS2012), pp. 790-794.
[24] E. S. Chung, P. A. Milder, J. C. Hoe, and K. Mai, “Single-Chip Hetero-
geneous Computingoes the Future Include Custom Logic, FPGAs, and
GPGPUs,” in Proc. 43rd Annual IEEE/ACM International Symposium on
Microarchitecture, Atlanta, GA, Dec 4-8, 2010.
[25] Xilinx. [Online]. Available: http://www.xilinx.com/products/silicon-devices/soc/zynq-7000/index.htm


来源:stepzhibin的专栏
记录学习中的点点滴滴,让每一天过的更加有意义!
返回列表