ORB (FAST+BRIEF) feature extraction and implementation-analysis of feature point extraction algorithm

before: This blog post mainly describes the ORB feature point extraction algorithm, including its decomposition,

The generation of FAST feature points , the generation of BRIEF descriptors. Then implement feature points on FPGA

Extract the introduction. These good bedding after the foundation, in the next blog post, the carefully how

Use FPGA to realize high-speed feature point extraction. Such as how to achieve this in parallel with VHDL a

algorithm. When reading this article, remember to read the next blog post!


I. Introduction

 1. Summary :


 The detection and extraction of image features is one of the most important research areas of computer vision. The ORB (Oriented FAST and Rotated BRIEF) algorithm is currently the fastest and stable feature point detection and extraction algorithm. Many image stitching and target tracking technologies are implemented using ORB features. . However, most of the current research is based on general computing hardware such as CPU or GPU. Due to its slow speed and high power consumption, it is not suitable for embedded and miniaturized equipment for real-time image processing. With the development of real-time high-speed vision, traditional image sensors and processing architectures can no longer meet the image processing requirements of high-speed moving targets. This article uses FPGA (Field Programmble Gate Array) to accelerate hardware image processing in the research. FPGA's low power consumption, low cost and high-speed parallel computing capabilities enable the real-time high-speed feature point detection system proposed in this design to be successfully implemented.

 This research uses a high-speed vision platform as the experimental equipment, and the realization of real-time high-speed feature point detection is the research content. The thesis first analyzes the improvement of the anti-noise and rotation invariance of the FAST feature point detection algorithm for the ORB detection algorithm and the noise resistance and rotation invariance improvement of the BRIEF descriptor generation algorithm, and describes the principle of image feature point matching in practical applications. In order to reflect the rapid stability of the ORB algorithm, the SIFT algorithm and the SURF algorithm are introduced for comparison. Then in the Visual Studio 2013 development environment, using the C++ programming language and using the OpenCV open source vision library, three different extraction algorithms were implemented. A large number of comparative experiments have been carried out on image intensity changes, scale changes and rotation changes to verify the accuracy and rapidity of the improved ORB feature point detection algorithm, and certain simplifications and improvements have been made for the high-speed vision platform. Then by analyzing the FPGA development process and parallel processing architecture, combined with the image processing module distribution characteristics of the IDP Express high-speed vision platform, the image signal transmission mechanism of the high-speed image acquisition card was analyzed, and the FAST feature point detection algorithm adopted was improved. Then the detection algorithm is divided into a data preparation module, a data processing module, and a data output module for a top-down modular design. With the help of the IP core provided by the ISE development platform, VHDL language was used for design input for various calculations and data operations. Finally, through the steps of simulation, debugging, and synthesis, the configuration file generated by the designed FPGA-based real-time high-speed feature point detection algorithm is burned to the Xilinx Spartan3xc3s5000-4fg900 FPGA chip, and the high-speed moving target is characterized by the complete set of high-speed vision platform Point detection. On the basis of a large number of experiments, it is verified that the designed system can perform real-time detection of target feature points at a speed of 250fps, and the detection effect of the designed real-time high-speed feature point detection system is evaluated through experimental data. Compared with the feature point detection method implemented by traditional software, the FPGA-based feature point detection system designed by this research has a speed increase of nearly 30 times, and the designed hardware detection system can process 512×512 size at 2000fps. image. 

 2. Introduction: The feature detection and extraction of ORB (Oriented FAST and Rotated BRIEF) algorithm is the process of obtaining the key objects in the image or video transmitted by the vision sensor. Combining the extracted features, the feature-based target matching is to achieve target detection. The core process [1] . At present, due to the computational complexity of detection and matching, the industry usually uses offline video combined with CPU for target extraction. Therefore, applying feature extraction algorithms to high-speed real-time scenes is a technical difficulty and key point.

 The research in the past ten years has usually focused on reducing the complexity of the algorithm and improving the detection accuracy on the CPU. In the current field of robotics and technology development, low power consumption, high-speed real-time and small resource consumption are often required. In order to solve the problem of running on embedded or small devices, it is necessary to rely on ASIC (application-specific custom integrated circuit) or FPGA (field programmable logic gate array). Because ASIC is expensive, it can take advantage of FPGA's reconfigurability, high-speed processing clock and other advantages, which can be competent for our processing work [2] .

 In order to study and solve real-time and high-speed feature point extraction, this article will focus on analyzing the ORB feature point detection algorithm, and use the improved ORB algorithm to conduct related experiments. Under ensuring the correctness of the processing, real-time feature point detection is performed by combining software and FPGA. The final experiment shows that our system can successfully perform feature point detection at a rate of 52.4 MPixel/s on a high-speed visual capture card.


 2. Research background and significance

 2.1 Subject research background


 人的眼睛和大脑的视觉处理系统,能够每秒处理10~12张分散图片。与人类的触觉和听觉相比,人类的视觉系统处理速度相对较慢。在类人机器人领域,常规处理速度(30~60fps)的视觉能够满足要求。然而,在许多需要高速视觉的场合,例如汽车碰撞分析,机械结构破碎性能分析,高速目标追踪,炸弹引爆能力分析等,使用肉眼,难以研究,只能借助离线高速摄像机,将场景记录下来,随后对捕捉的高速图像序列进行分析[3]

 目前,针对图像的目标检测,特征提取技术以及实时追踪技术,一直是高速视觉研究的重点方向。许多嵌入式机器人视觉处理应用需要实时高速的解决方案,要求传感器的工作频率在1KHz以上。工业场景中,一些高速移动目标用肉眼难以发现和追踪,这就需要引入并行同步计算架构,将视觉反馈控制在毫秒或者微秒级别,来加速处理,实时提取目标,为机器人的运动控制提供决策,同时降低CPU的计算负荷和能耗,这是目前急需解决的难题。

 最近十几年,已经开发出多套实时高速视觉系统,通过高速视觉(500~10000fps)反馈信息进行实时在线控制,进行高速运动目标的实时追踪。随着视频图像等视觉数据的日益增长,高速视觉传感器不断创新,广泛用于实时高速视觉反馈系统。由于高速视觉具有1)两帧之间位移小;2)实时图像处理的复杂时序和有限的处理器资源等特性。因此,实时高速视觉对大量数据进行实时处理要求较高[3]。有研究提出采用GPU进行图像的加速处理,虽然GPU的处理速度较快,但相对于FPGA,GPU需要巨大的计算资源,较高的功耗,不适用于嵌入式或者小型的智能机器人。由于FPGA的并行处理架构,数十万个逻辑单元,能满足各种组合逻辑和时序逻辑[4]。这种特性正好适用于高并行度,低复杂程度,低的内存资源消耗以及低功耗,在处理实时高速视觉具有明显优势。 


 2.2 课题研究意义


 对于怎样选取特征点来表述目标,使得目标特征独一无二,便于在特征空间中识别出来。常用的目标特征有颜色,边缘,纹理,光流等。对于不同的特征,有颜色特征提取算法,形状特征提取算法和基于边缘轮廓特征的提取算法。在目标检测和提取的算法中,目前有较好的三种算法被广泛应用,SIFT(尺度不变特征转换)算法,增强版本的SURF(具有加速鲁棒性的特征提取)算法,ORB(定向的FAST检测和旋转的BRIEF描述子)算法。实验显示SIFT和SURF算法复杂,处理速度慢,而ORB的计算速度是SIFT的10倍,且具有良好的旋转不变性和抗噪性[5] 由于实时高速图像的特征检测受到光照变化、图像旋转、尺度变化以及噪声等不利环境的影响。决定在研究中采用稳定性优异,鲁棒性强的ORB算法来实现目标的检测提取和特征点匹配。由于应用于高速运动的目标中,受限于图像传感器的速度和精度,CPU的处理速度,以及算法的复杂程度,现有的软件特征提取算法和目标匹配算法,不能实时地应对图像的特征点检测和目标匹配。决定采用基于FPGA(Field Programmble Gate Array)的硬件图像加速处理算法,提前对输入图像进行特征点检测等计算任务繁重的算法进行计算,随后传输给软件进行后续处理。通过以上的方案,能解决实时高速图像目标提取和匹配,为后续的对识别目标进行实时高速追踪进行技术铺垫。在完成一系列处理后,就能够实现高级视觉应用,为实时高速视觉的行为推理,人工智能分析以及图像理解等,打下坚实基础。综上所述,本论文所研究的利用FPGA实现基于ORB算法的实时高速目标点检测,提取,特征匹配,具有重要理论价值和工程应用潜力。


 2.3 本文的研究内容


 在计算机视觉领域中,对目标的检测和描述等相关算法研究已经相当成熟。有Harris角点检测,FAST角点检测算法,Shi-Tomasi角点检测算法;描述算法有SIFT、BRIEF、SURF等。但是目前的研究主要基于CPU或者GPU平台进行实现。由于相机与PC之间传输速度的限制,帧率很难达到100帧,且功耗大,设备复杂,因此不适用于机器人或无人机等小型设备进行实时检测。本研究课题针对这几个问题,重点解决并实现了特征点检测的实时性,高速处理和低功耗的问题。以下为本文的具体内容:

 概述了实时高速视觉、特征检测算法的国内外研究发展现状,结合目前的研究现状简要说明项目的研究背景和实际意义。最后总结叙述了论文的研究工作和结构安排。

 ORB特征点检测算法的理论分析。对特征点的意义进行了说明,详细分析了ORB算法的改进思路,包括对FAST特征点检测算法增加特征点主方向,以及在BRIEF描述子生成算法中,进行的特征抗噪性和旋转不变性改进。最后对实际应用中的特征点匹配原理进行了叙述。

 ORB特征点检测算法软件实现与性能评估。为了体现出ORB算法的快速性和稳定性,将该算法与SIFT算法和SURF算法在特征点检测效果上进行对比。采用C++编程语言在VS2013开发环境上,结合OpenCV开源视觉库实现了改进的ORB特征点检测算法。最后通过对图像的强度变化,尺度变化和旋转变化进行对比实验,验证了ORB特征点检测算法的准确性和快速性。

 实时高速特征点检测算法设计。通过分析基于FPGA的实时高速视觉系统的特点,增大了算法处理的并行度,将FAST特征点检测算法进行改进和优化,对算法的硬件电路映射进行分析。最后将特征点检测算法分为三个模块,进行了自顶向下的设计:1、数据准备模块,传入固定大小的图像矩阵;2、数据处理模块,对图像邻域进行特征点检测,矩计算等操作;3、数据输出模块,输出处理的数据和信号到下一个功能模块。系统能将图像的特征点个数、坐标信息以及主方向信息保存在每一帧图像的最底部。

 基于FPGA的实时高速特征点检测算法硬件实现。通过算法的输入,仿真调试,编译器综合,将配置文件烧写到Xilinx Spartan3 xc3s5000-4fg900 FPGA芯片上进行硬件电路搭建。通过整套高速视觉平台实现了运动目标特征点检测,对检测的效果,特征点主方向信息进行分析,验证了所设计的实时高速特征点检测系统的性能。

 总结与展望。总结了全文所做的理论分析,设计流程和实现实时高速特征点检测系统的研究步骤。


 三 、特征点的概述(Overviewof keypoints)


 在目标识别的过程中,关键在于选取怎样的特征来表示目标。理想的视觉特征通常唯一的显示目标,且容易在相应的特征空间中识别和提取。对于目标的识别,可以用一组或多组特征来进行检测和分类。其中形状特征是局部信息,在遮挡情况下,目标的形状信息不完整,效果较差。而采用特征点检测的方法,能在全局实现,不依赖局部信息,在整个图像中获得所有的特征,能全面的表示多目标以及复杂背景。

 特征点检测(keypoints detection)是计算机视觉利用图像信息获取图像所含特征数据的一种方法,包括计算特征点的主方向,坐标,灰度值和梯度等信息。广泛应用在3D重建,目标跟踪,图像匹配等热门领域。20世纪70年代学者就提出了图像特征点的概念:某像素的一阶导数具有局部最大值,二阶导数为零,表示对象边缘变化不连续的方向,这个像素点就是图像的特征点[13]。1988年哈里斯等正式提出了一种通过点的灰度值变化计算特征的方法。哈里斯算法的核心思路是:利用微分算子,取代滑动窗口的移动,构建了2×2的哈里斯矩阵M,然后,计算角点响应函数:


 2000年,局部特征研究的一个突破方法被Lowe提出,这就是著名的SIFT(Scale Invariant Feature Transform)算法。Lowe通过建立了图像金字塔,在不同尺度空间将DOG与不同尺度图片进行卷积,加速了特征的提取[13]。2006年,Bay在SIFT算法的基础上,将哈里斯小波和积分图像相结合,实现了SURF(Speed Up Robust Features)特征提取算法,该算法比SIFT快3倍,在图像旋转,尺度变换方面比SIFT更加稳定[14]。为了能在手机,机器人等实时、低功耗设备上进行目标识别,图像拼接等功能,2011年,Rublee等提出了一个有效的代替SIFT和SURF的算法——ORB算法。通过实验表明,ORB算法的检测速度比SIFT算法快两个数量级,是SURF算法的3倍,且性能更加鲁棒。

 ORB算法是结合了著名的FAST特征点检测算法和BRIEF描述子生成算法,作为一种新的局部不变特征算法,ORB对图像的缩放,旋转,平移等变换,具有特征不变性[1]。RubLee等将BRIEF算法中的随机点比较生成的描述子方法,改善为在特征点的31×31的邻域内,生成随机点的5×5子窗口,采用积分和来生成描述子,使得鲁棒性增强。结合并改进这算法后,ORB的速度有了大幅提升。


 四 、ORB特征点检测算法(ORB keypoints detection algorithm)


 特征点检测算法在我之前的博客中讲解过,参考链接 ORB特征提取算法分析与实现,算法分解  !

 ORB利用FAST来检测特征点,并计算特征点主方向,生成oFAST(Oriented FAST)。这种思路在利用FAST算法的快速检测性的同时,较好的解决FAST检测子的不具有方向性的缺点[24]

 在FAST这篇论文中,提出了角点的定义:在以某一像素点为中心的邻域内,若有足够多的像素点灰度值与该中心像素值差别较大,则该点可能是角点[13]。该算法的基本原理是,选定圆心像素点p,在半径为3的圆周内,有16个像素点[15]。如图2.1所示。



 在这圆周上,如果存在连续n个像素值与p的灰度值做差,如果绝对值同时大于或者小于t,则这个点为候选点,然后进一步筛选;否则直接判断为非候选点。

 因此,圆周上的每一个x点相对于中心点p必属于以下3种状态:


其中, Ip表示中心点的灰度值,Ip->x表示以p点为圆心的圆周上的点x的灰度值,t表示阈值。状态d表示像素点x比中心点p暗,b表示像素点x比中心点p亮,s表示相似。

 为了加快计算,首先计算图中圆周上点1和9(垂直方向),如果1和9满足Ip->x<=Ip-t或者Ip+t<=Ip->x,则继续计算图上的点5和13(水平方向)。如果有这4个点有3个或3个以上的点满足Ip->x<=Ip-t或者Ip+t<=Ip-t,则进一步检查剩下的12个点,否则不是角点。

 按公式算出N:


 如果N>=9(FAST-9)或者N>=12(FAST-12),则p为角点,官方推荐N取9,在速度和精度都能满足要求。但FAST本身就存在缺点:1)FAST没有角点响应函数;2)检测器的效率取决于排序问题;3)FAST没有引入多尺度特征。针对这几个问题,ORB算法计算采用:1、对于目标数量K为个关键点,先设定较低的阈值来得到大于K个关键点的候选点,然后根据Harris角点响应来对K个特征点进行排序,选择前K个特征点;2)采用图像金字塔,通过Harris滤波在每层金字塔中得到FAST特征[1]。其中,Harris角点响应函数可以通过图像差分矩阵M得到:


 FAST特征点不具有方向性,在图像旋转情况下,性能很差。于是,RubLee等利用灰度质心法(IntensityCentriod)为每个特征点计算了主方向。

 灰度质心法是假设某特征点的灰度与该邻域重心之间存在偏移,通过这个特征点到重心的向量,就能算出该特征点的主方向[24]。Rosin将邻域矩(moment)定义为:


 因此可以得到图像的0阶矩,1阶矩为:


 邻域质心为:

 
 得到一个角点到质心的向量OC 。因此,特征点主方向为:

其中,atan2()函数返回的是角点到(M01,M10)的方位角。计算中,不用考虑到角点在邻域中是较亮还是较暗的点,因为角度的测量是一致的,不依赖角点的类型。

 随后,通过了两个梯度测量来比较质心法,BIN和MAX。如图2.2所示,对模拟数据集中图像平面进行旋转并加上噪声后的方向的方差。


 从图中可以看出,灰度质心法(IC)在人工旋转和噪声的影响 ,与BIN和MAX算法相比,具有最好的恢复主方向的性能,即使在较大的图像噪声和旋转下,均有良好的定向。


 五 、ORB描述子生成算法


 ORB算法采用了Calonder等提出的BRIEF算法,并在两个方面对BRIEF算法进行了改进:

 (1)采用积分图像解决BRIEF算法的噪声敏感性;

 (2)利用改进的FAST算法求得的特征点主方向,先对BRIEF生成的描述子进行旋转,后判别和二进制编码,使得描述子具有旋转不变性[25]

 假设一副平滑的图像,在大小为S×S的邻域P中,进行τ测试:











 下一篇博文介绍如何实现ORB特征点提取算法,包括与SIFT和SURF算法的性能对比,以及FPGA实现实时高速特征点提取的结构设计,高速系统分析,以及特征点提取模块的构成!

Guess you like

Origin blog.csdn.net/qq_32998593/article/details/79221641