|
RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
|
Represents a visual word (feature descriptor) used in the bag-of-words (BoW) model. More...
#include <VisualWord.h>
Public Member Functions | |
| VisualWord (int id, const cv::Mat &descriptor, int signatureId=0) | |
| Constructor. | |
| ~VisualWord () | |
| Destructor. | |
| void | addRef (int signatureId) |
| Adds a reference to this word for the given signature ID. | |
| int | removeAllRef (int signatureId) |
| Removes all references to this word for the given signature ID. | |
| unsigned long | getMemoryUsed () const |
| Estimates the memory used by this visual word in bytes. | |
| int | getTotalReferences () const |
| Returns the total number of references (across all signatures). | |
| int | id () const |
| Returns the ID of this visual word. | |
| const cv::Mat & | getDescriptor () const |
| Returns the feature descriptor of this word. | |
| const std::map< int, int > & | getReferences () const |
| Returns the references of this word. | |
| bool | isSaved () const |
| Checks if the word has been saved to the database. | |
| void | setSaved (bool saved) |
| Sets the saved flag for the word. | |
Represents a visual word (feature descriptor) used in the bag-of-words (BoW) model.
A VisualWord holds a unique identifier, its descriptor (usually a feature vector from an image), and a record of where (in which signatures/images) it was observed. This is a key component in loop closure detection and visual place recognition in RTAB-Map.
The word keeps track of references (signature IDs) where it appears, and how many times it was observed in each signature. It also tracks whether the word has been saved to a database.
Definition at line 49 of file VisualWord.h.
| rtabmap::VisualWord::VisualWord | ( | int | id, |
| const cv::Mat & | descriptor, | ||
| int | signatureId = 0 |
||
| ) |
| void rtabmap::VisualWord::addRef | ( | int | signatureId | ) |
Adds a reference to this word for the given signature ID.
| signatureId | ID of the signature in which this word is observed. |
| int rtabmap::VisualWord::removeAllRef | ( | int | signatureId | ) |
Removes all references to this word for the given signature ID.
| signatureId | ID of the signature from which references will be removed. |
| unsigned long rtabmap::VisualWord::getMemoryUsed | ( | ) | const |
Estimates the memory used by this visual word in bytes.
|
inline |
Returns the total number of references (across all signatures).
Definition at line 88 of file VisualWord.h.
|
inline |
|
inline |
Returns the feature descriptor of this word.
Definition at line 100 of file VisualWord.h.
|
inline |
Returns the references of this word.
Definition at line 106 of file VisualWord.h.
|
inline |
Checks if the word has been saved to the database.
Definition at line 112 of file VisualWord.h.
|
inline |
Sets the saved flag for the word.
| saved | True if the word has been saved to the database. |
Definition at line 118 of file VisualWord.h.