SLAM: Orb_SLAM中的ORB特征
原文鏈接:什么是ORB
關于Orb特征的獲取:參考 最新版的OpenCV中新增加的ORB特征的使用
ORB是是ORiented Brief 的簡稱,對Brief的特定性質進行了改進。
ORB的描述在下面文章中:
??????? Ethan Rublee and Vincent Rabaud and Kurt Konolige and Gary Bradski,ORB: an ef?cient alternative to SIFT or SURF, ICCV 2011
??????? 沒有加上鏈接是因為作者確實還沒有放出論文,不過OpenCV2.3RC中已經有了實現,WillowGarage有一個talk也提到了這個算法,因此我不揣淺陋,在這里總結一下。
??????? Brief是Binary Robust Independent Elementary Features的縮寫。這個特征描述子是由EPFL的Calonder在ECCV2010上提出的。主要思路就是在特征點附近隨機選取若干點對,將這些點對的灰度值的大小,組合成一個二進制串,并將這個二進制串作為該特征點的特征描述子。詳細算法描述參考如下論文:
Calonder M., Lepetit V., Strecha C., Fua P.: BRIEF: Binary Robust Independent Elementary Features. ECCV 2010
?????? 注意在BRIEF eccv2010的文章中,BRIEF描述子中的每一位是由隨機選取的兩個像素點做二進制比較得來的。文章同樣提到,在此之前,需要選取合適的gaussian kernel對圖像做平滑處理。(為什么要強調這一點,因為下述的ORB對此作了改進。)
?????? BRIEF的優點在于速度,缺點也相當明顯:
????? ? ? ??? 1:不具備旋轉不變性。
???? ? ? ? ?? 2:對噪聲敏感
????????????? 3:不具備尺度不變性。
?????? ORB就是試圖解決上述缺點中的1和2.
如何解決旋轉不變性:
???????? 在ORB的方案中,是采用了FAST作為特征點檢測算子。FAST應用的很多了,是出名的快,以防有人不知道,請看這里:
FastCornerDetecting
??????? 在Sift的方案中,特征點的主方向是由梯度直方圖的最大值和次大值所在的bin對應的方向決定的。略嫌耗時。
????? ? 在ORB的方案中,特征點的主方向是通過矩(moment)計算而來,公式如下:
?????? 有了主方向之后,就可以依據該主方向提取BRIEF描述子。但是由此帶來的問題是,由于主方向會發生變化,隨機點對的相關性會比較大,從而降低描述子的判別性。解決方案也很直接,采取貪婪的,窮舉的方法,暴力找到相關性較低的隨機點對。
如何解決對噪聲敏感的問題:
??????? 在前面提到過,在最早的eccv2010的文章中,BRIEF使用的是pixel跟pixel的大小來構造描述子的每一個bit。這樣的后果就是對噪聲敏感。因此,在ORB的方案中,做了這樣的改進,不再使用pixel-pair,而是使用9×9的patch-pair,也就是說,對比patch的像素值之和。(可以通過積分圖快速計算)。
關于尺度不變性:
???????? ORB沒有試圖解決尺度不變性,(因為FAST本身就不具有尺度不變性。)但是這樣只求速度的特征描述子,一般都是應用在實時的視頻處理中的,這樣的話就可以通過跟蹤還有一些啟發式的策略來解決尺度不變性的問題。
關于計算速度:
??????? ORB是sift的100倍,是surf的10倍。
關于性能:
?????? 下面是一個性能對比,ORB還是很給力。點擊看大圖。?????????
結果評測...............................
OpenCV的參數描述:
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.?? 最多保留特征的個數
?????? 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的浮點數。2表示1/4像素抽取。接近于1需要多次抽取擴增實現浮點級別的金字塔效果。
?????? 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.
?????? 邊緣閾值:大致等同于塊大小參數。
?????? 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描述子的選取?隨機匹配種子點?個數。
??????? 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 );??? 默認使用了HARRIS角點檢測的算法。
??????? 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.?? 檢測特征?局部塊?大小。
使用OpenCV的代碼段
?
cv::Mat mDescriptors;//每一列關聯到一個ORB特征cv::ORB m_Orb;//提取器m_Orb.detect( im, mvKeys );m_Orb.compute( im, mvKeys, mDescriptors);
總結
以上是生活随笔為你收集整理的SLAM: Orb_SLAM中的ORB特征的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为云发布自动驾驶开发平台 可帮车企降低
- 下一篇: PS5 版《暗黑破坏神 4》M 站用户评