NDEVR
API Documentation
KeyFrameDatabase

Database of keyframes for place recognition and relocalization. More...

Collaboration diagram for KeyFrameDatabase:
[legend]

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW KeyFrameDatabase ()
 Default constructor.
 KeyFrameDatabase (const ORBVocabulary &voc)
 Constructs the database with an ORB vocabulary.
void add (KeyFrame *pKF)
 Adds a keyframe to the database.
void clear ()
 Clears all entries from the database.
void clearMap (Map *pMap)
 Clears entries belonging to a specific map.
void DetectBestCandidates (KeyFrame *pKF, Buffer< KeyFrame * > &vpLoopCand, Buffer< KeyFrame * > &vpMergeCand, uint04 nMinWords)
 Detects the best loop and merge candidates by word count.
void DetectCandidates (KeyFrame *pKF, float minScore, Buffer< KeyFrame * > &vpLoopCand, Buffer< KeyFrame * > &vpMergeCand)
 Detects loop and merge candidates simultaneously.
Buffer< KeyFrame * > DetectLoopCandidates (KeyFrame *pKF, float minScore)
 Detects loop closure candidates (deprecated).
void DetectNBestCandidates (KeyFrame *pKF, Buffer< KeyFrame * > &vpLoopCand, Buffer< KeyFrame * > &vpMergeCand, uint04 nNumCandidates)
 Detects the N best loop and merge candidates.
Buffer< KeyFrame * > DetectRelocalizationCandidates (Frame *F, Map *pMap)
 Detects relocalization candidates for a given frame.
void erase (KeyFrame *pKF)
 Removes a keyframe from the database.
void SetORBVocabulary (ORBVocabulary *pORBVoc)
 Updates the ORB vocabulary.

Protected Member Functions

Buffer< KeyFrame * > filter (Frame *pKFi, const Buffer< KeyFrame * > &filter, KeyFrame::ScoreEnum type, fltp04 min_score, uint04 min_words=0, uint04 max_count=Constant< uint04 >::Invalid)
 Filters candidates from a pre-selected set.
Buffer< KeyFrame * > findCanditates (KeyFrame *pKFi, KeyFrame::ScoreEnum type, fltp04 min_score, uint04 min_words=0, uint04 max_count=Constant< uint04 >::Invalid)
 Finds candidate keyframes matching a query.

Protected Attributes

std::mutex mMutex
 Mutex for thread-safe access.
const ORBVocabularympVoc = nullptr
 Associated ORB vocabulary.
Buffer< Buffer< KeyFrame * > > mvInvertedFile
 Inverted file mapping word IDs to keyframes.

Detailed Description

Database of keyframes for place recognition and relocalization.

Maintains an inverted file index of visual words to keyframes, enabling efficient detection of loop closure, merge, and relocalization candidates.

Definition at line 20 of file KeyFrameDatabase.h.

Constructor & Destructor Documentation

◆ KeyFrameDatabase()

KeyFrameDatabase::KeyFrameDatabase ( const ORBVocabulary & voc)

Constructs the database with an ORB vocabulary.

Parameters
[in]vocThe ORB vocabulary for visual word lookup.

Member Function Documentation

◆ add()

void KeyFrameDatabase::add ( KeyFrame * pKF)

Adds a keyframe to the database.

Parameters
[in]pKFKeyframe to add.

◆ clearMap()

void KeyFrameDatabase::clearMap ( Map * pMap)

Clears entries belonging to a specific map.

Parameters
[in]pMapMap whose keyframes should be removed.

◆ DetectBestCandidates()

void KeyFrameDatabase::DetectBestCandidates ( KeyFrame * pKF,
Buffer< KeyFrame * > & vpLoopCand,
Buffer< KeyFrame * > & vpMergeCand,
uint04 nMinWords )

Detects the best loop and merge candidates by word count.

Parameters
[in]pKFQuery keyframe.
[out]vpLoopCandBuffer to fill with loop candidates.
[out]vpMergeCandBuffer to fill with merge candidates.
[in]nMinWordsMinimum shared word count.

◆ DetectCandidates()

void KeyFrameDatabase::DetectCandidates ( KeyFrame * pKF,
float minScore,
Buffer< KeyFrame * > & vpLoopCand,
Buffer< KeyFrame * > & vpMergeCand )

Detects loop and merge candidates simultaneously.

Parameters
[in]pKFQuery keyframe.
[in]minScoreMinimum similarity score threshold.
[out]vpLoopCandBuffer to fill with loop candidates.
[out]vpMergeCandBuffer to fill with merge candidates.

◆ DetectLoopCandidates()

Buffer< KeyFrame * > KeyFrameDatabase::DetectLoopCandidates ( KeyFrame * pKF,
float minScore )

Detects loop closure candidates (deprecated).

Parameters
[in]pKFQuery keyframe.
[in]minScoreMinimum similarity score threshold.
Returns
Buffer of candidate keyframes.

◆ DetectNBestCandidates()

void KeyFrameDatabase::DetectNBestCandidates ( KeyFrame * pKF,
Buffer< KeyFrame * > & vpLoopCand,
Buffer< KeyFrame * > & vpMergeCand,
uint04 nNumCandidates )

Detects the N best loop and merge candidates.

Parameters
[in]pKFQuery keyframe.
[out]vpLoopCandBuffer to fill with loop candidates.
[out]vpMergeCandBuffer to fill with merge candidates.
[in]nNumCandidatesMaximum number of candidates to return.

◆ DetectRelocalizationCandidates()

Buffer< KeyFrame * > KeyFrameDatabase::DetectRelocalizationCandidates ( Frame * F,
Map * pMap )

Detects relocalization candidates for a given frame.

Parameters
[in]FQuery frame.
[in]pMapMap to search within.
Returns
Buffer of relocalization candidate keyframes.

◆ erase()

void KeyFrameDatabase::erase ( KeyFrame * pKF)

Removes a keyframe from the database.

Parameters
[in]pKFKeyframe to remove.

◆ filter()

Buffer< KeyFrame * > KeyFrameDatabase::filter ( Frame * pKFi,
const Buffer< KeyFrame * > & filter,
KeyFrame::ScoreEnum type,
fltp04 min_score,
uint04 min_words = 0,
uint04 max_count = Constantuint04 >::Invalid )
protected

Filters candidates from a pre-selected set.

Parameters
[in]pKFiQuery frame.
[in]filterPre-selected candidate buffer.
[in]typeScore type.
[in]min_scoreMinimum similarity score.
[in]min_wordsMinimum shared word count.
[in]max_countMaximum number of candidates.
Returns
Buffer of filtered candidate keyframes.

References filter().

Referenced by filter().

◆ findCanditates()

Buffer< KeyFrame * > KeyFrameDatabase::findCanditates ( KeyFrame * pKFi,
KeyFrame::ScoreEnum type,
fltp04 min_score,
uint04 min_words = 0,
uint04 max_count = Constantuint04 >::Invalid )
protected

Finds candidate keyframes matching a query.

Parameters
[in]pKFiQuery keyframe.
[in]typeScore type (merge, loop, relocation, place recognition).
[in]min_scoreMinimum similarity score.
[in]min_wordsMinimum shared word count.
[in]max_countMaximum number of candidates.
Returns
Buffer of candidate keyframes.

◆ SetORBVocabulary()

void KeyFrameDatabase::SetORBVocabulary ( ORBVocabulary * pORBVoc)

Updates the ORB vocabulary.

Parameters
[in]pORBVocPointer to the new ORB vocabulary.

The documentation for this class was generated from the following file: