keypoint數據結構


公有屬性

(float)angle:角度,表示關鍵點的方向,-1為初值。

(int)class_id:當要對圖片進行分類時,我們可以用class_id對每個特征點進行區分,未設定時為-1,需要靠自己設定

(int)octave:代表是從金字塔哪一層提取的得到的數據。

(Point2f)pt:關鍵點的點坐標

(float)response:響應程度,代表該點強壯大小—response代表着該關鍵點how good,更確切的說,是該點角點的程度。

(float)size:該點直徑的大小

公有成員函數

三個構造函數

KeyPoint () : 默認構造函數

KeyPoint (Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1)

參數
    _pt	     : 關鍵點的x和y坐標
    _size	 : 關鍵點直徑
    _angle	 : 關鍵點方向
    _response:關鍵點上的關鍵點檢測器響應(即關鍵點的強度)
    _octave	 : 已檢測到關鍵點的pyramid octave
    _class_id: 關鍵點ID

KeyPoint (float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1)

參數
    x	     : 關鍵點的x坐標
    y	     : 關鍵點的y坐標
    _size	 : 關鍵點直徑
    _angle	 : 關鍵點方向
    _response:關鍵點上的關鍵點檢測器響應(即關鍵點的強度)
    _octave	 : 已檢測到關鍵點的pyramid octave
    _class_id: 關鍵點ID

size_t hash () const

靜態公有成員函數
static void convert (const std::vector< KeyPoint > &keypoints, std::vector< Point2f > &points2f, const std::vector< int > &keypointIndexes=std::vector< int >())

此方法將關鍵點的矢量轉換為點矢量或反向,其中每個關鍵點被指定相同的大小和相同的方向。

參數
keypoints	    : 從任何特征檢測算法(如SIFT / SURF / ORB)獲得的關鍵點
points2f	    : 每個關鍵點的(x,y)坐標數組
keypointIndexes	: 要轉換為點的關鍵點的索引數組。(像掩碼一樣只轉換指定的關鍵點)

static void convert (const std::vector< Point2f > &points2f, std::vector< KeyPoint > &keypoints, float size=1, float response=1, int octave=0, int class_id=-1)

這是一個重載的成員函數,為方便起見而提供。它與上述函數的不同之處僅在於它接受的參數。

參數
points2f  : 每個關鍵點的(x,y)坐標數組
keypoints : 從任何特征檢測算法(如SIFT / SURF / ORB)獲得的關鍵點
size	  : 關鍵點直徑
response  : 關鍵點上的關鍵點檢測器響應(即關鍵點的強度)
octave	  : 已檢測到關鍵點的pyramid octave
class_id  : 關鍵點 id

static float overlap (const KeyPoint &kp1, const KeyPoint &kp2)

此方法計算關鍵點對的重疊。重疊是關鍵點區域交叉區域與關鍵點區域聯合區域之間的比率(將關鍵點區域視為圓圈)。如果它們不重疊,我們就會得到零。如果它們在相同大小的相同位置重合,我們得到1。

參數
    kp1	: First keypoint
    kp2	: Second keypoint


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM