SLAM: Orb_SLAM中的ORB特征
原文鏈接:什么是ORB
關(guān)于Orb特征的獲取:參考 最新版的OpenCV中新增加的ORB特征的使用
ORB是是ORiented Brief 的簡(jiǎn)稱(chēng),對(duì)Brief的特定性質(zhì)進(jìn)行了改進(jìn)。
ORB的描述在下面文章中:
??????? Ethan Rublee and Vincent Rabaud and Kurt Konolige and Gary Bradski,ORB: an ef?cient alternative to SIFT or SURF, ICCV 2011
??????? 沒(méi)有加上鏈接是因?yàn)樽髡叽_實(shí)還沒(méi)有放出論文,不過(guò)OpenCV2.3RC中已經(jīng)有了實(shí)現(xiàn),WillowGarage有一個(gè)talk也提到了這個(gè)算法,因此我不揣淺陋,在這里總結(jié)一下。
??????? Brief是Binary Robust Independent Elementary Features的縮寫(xiě)。這個(gè)特征描述子是由EPFL的Calonder在ECCV2010上提出的。主要思路就是在特征點(diǎn)附近隨機(jī)選取若干點(diǎn)對(duì),將這些點(diǎn)對(duì)的灰度值的大小,組合成一個(gè)二進(jìn)制串,并將這個(gè)二進(jìn)制串作為該特征點(diǎn)的特征描述子。詳細(xì)算法描述參考如下論文:
Calonder M., Lepetit V., Strecha C., Fua P.: BRIEF: Binary Robust Independent Elementary Features. ECCV 2010
?????? 注意在BRIEF eccv2010的文章中,BRIEF描述子中的每一位是由隨機(jī)選取的兩個(gè)像素點(diǎn)做二進(jìn)制比較得來(lái)的。文章同樣提到,在此之前,需要選取合適的gaussian kernel對(duì)圖像做平滑處理。(為什么要強(qiáng)調(diào)這一點(diǎn),因?yàn)橄率龅腛RB對(duì)此作了改進(jìn)。)
?????? BRIEF的優(yōu)點(diǎn)在于速度,缺點(diǎn)也相當(dāng)明顯:
????? ? ? ??? 1:不具備旋轉(zhuǎn)不變性。
???? ? ? ? ?? 2:對(duì)噪聲敏感
????????????? 3:不具備尺度不變性。
?????? ORB就是試圖解決上述缺點(diǎn)中的1和2.
如何解決旋轉(zhuǎn)不變性:
???????? 在ORB的方案中,是采用了FAST作為特征點(diǎn)檢測(cè)算子。FAST應(yīng)用的很多了,是出名的快,以防有人不知道,請(qǐng)看這里:
FastCornerDetecting
??????? 在Sift的方案中,特征點(diǎn)的主方向是由梯度直方圖的最大值和次大值所在的bin對(duì)應(yīng)的方向決定的。略嫌耗時(shí)。
????? ? 在ORB的方案中,特征點(diǎn)的主方向是通過(guò)矩(moment)計(jì)算而來(lái),公式如下:
?????? 有了主方向之后,就可以依據(jù)該主方向提取BRIEF描述子。但是由此帶來(lái)的問(wèn)題是,由于主方向會(huì)發(fā)生變化,隨機(jī)點(diǎn)對(duì)的相關(guān)性會(huì)比較大,從而降低描述子的判別性。解決方案也很直接,采取貪婪的,窮舉的方法,暴力找到相關(guān)性較低的隨機(jī)點(diǎn)對(duì)。
如何解決對(duì)噪聲敏感的問(wèn)題:
??????? 在前面提到過(guò),在最早的eccv2010的文章中,BRIEF使用的是pixel跟pixel的大小來(lái)構(gòu)造描述子的每一個(gè)bit。這樣的后果就是對(duì)噪聲敏感。因此,在ORB的方案中,做了這樣的改進(jìn),不再使用pixel-pair,而是使用9×9的patch-pair,也就是說(shuō),對(duì)比patch的像素值之和。(可以通過(guò)積分圖快速計(jì)算)。
關(guān)于尺度不變性:
???????? ORB沒(méi)有試圖解決尺度不變性,(因?yàn)镕AST本身就不具有尺度不變性。)但是這樣只求速度的特征描述子,一般都是應(yīng)用在實(shí)時(shí)的視頻處理中的,這樣的話就可以通過(guò)跟蹤還有一些啟發(fā)式的策略來(lái)解決尺度不變性的問(wèn)題。
關(guān)于計(jì)算速度:
??????? ORB是sift的100倍,是surf的10倍。
關(guān)于性能:
?????? 下面是一個(gè)性能對(duì)比,ORB還是很給力。點(diǎn)擊看大圖。?????????
結(jié)果評(píng)測(cè)...............................
OpenCV的參數(shù)描述:
C++:ORB::ORB( int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31)Parameters:
?????? nfeatures – The maximum number of features to retain.?? 最多保留特征的個(gè)數(shù)
?????? scaleFactor – Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor will mean that to cover certain scale range you will need more pyramid levels and so the speed will suffer.
???? ? 縮放因子:金字塔抽取比率,大于1的浮點(diǎn)數(shù)。2表示1/4像素抽取。接近于1需要多次抽取擴(kuò)增實(shí)現(xiàn)浮點(diǎn)級(jí)別的金字塔效果。
?????? nlevels – The number of pyramid levels. The smallest level will have linear size equal to input_image_linear_size/pow(scaleFactor, nlevels).
?????? edgeThreshold – This is size of the border where the features are not detected. It should roughly match the patchSize parameter.
?????? 邊緣閾值:大致等同于塊大小參數(shù)。
?????? firstLevel – It should be 0 in the current implementation.
?????? WTA_K – The number of points that produce each element of the oriented BRIEF descriptor. The default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, so we get 0/1 response.????? Other possible values are 3 and 4. ?? For example, 3 means that we take 3 random points (of course, those point coordinates are random, but they are generated from the pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, denoted as NORM_HAMMING2 (2 bits per bin).????? When WTA_K=4, we take 4 random points to compute each bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3).
??????? 生成ORB描述子的選取?隨機(jī)匹配種子點(diǎn)?個(gè)數(shù)。
??????? scoreType – The default HARRIS_SCORE means that Harris algorithm is used to rank features ( the score is written to KeyPoint::score and is used to retain best nfeatures features );??? 默認(rèn)使用了HARRIS角點(diǎn)檢測(cè)的算法。
??????? FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, but it is a little faster to compute.
??????? patchSize – size of the patch used by the oriented BRIEF descriptor. Of course, on smaller pyramid layers the perceived image area covered by a feature will be larger.?? 檢測(cè)特征?局部塊?大小。
使用OpenCV的代碼段
?
cv::Mat mDescriptors;//每一列關(guān)聯(lián)到一個(gè)ORB特征cv::ORB m_Orb;//提取器m_Orb.detect( im, mvKeys );m_Orb.compute( im, mvKeys, mDescriptors);
總結(jié)
以上是生活随笔為你收集整理的SLAM: Orb_SLAM中的ORB特征的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 华为云发布自动驾驶开发平台 可帮车企降低
- 下一篇: SLAM: Orb_SLAM的使用小综述