ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim > Class Template Reference

#include <inverted_index.h>

Inheritance diagram for colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >:

Public Types

typedef Eigen::Matrix< kDescType, Eigen::Dynamic, kDescDim, Eigen::RowMajor > DescType
 
typedef InvertedFile< kEmbeddingDim >::EntryType EntryType
 
typedef InvertedFile< kEmbeddingDim >::GeomType GeomType
 
typedef Eigen::Matrix< float, Eigen::Dynamic, kDescDim > ProjMatrixType
 
typedef Eigen::VectorXf ProjDescType
 

Public Member Functions

 InvertedIndex ()
 
int NumVisualWords () const
 
void Initialize (const int num_words)
 
void Finalize ()
 
void GenerateHammingEmbeddingProjection ()
 
void ComputeHammingEmbedding (const DescType &descriptors, const Eigen::VectorXi &word_ids)
 
void AddEntry (const int image_id, const int word_id, typename DescType::Index feature_idx, const DescType &descriptor, const GeomType &geometry)
 
void ClearEntries ()
 
void Query (const DescType &descriptors, const Eigen::MatrixXi &word_ids, std::vector< ImageScore > *image_scores) const
 
void ConvertToBinaryDescriptor (const int word_id, const DescType &descriptor, std::bitset< kEmbeddingDim > *binary_descriptor) const
 
float GetIDFWeight (const int word_id) const
 
void FindMatches (const int word_id, const std::unordered_set< int > &image_ids, std::vector< const EntryType * > *matches) const
 
float ComputeSelfSimilarity (const Eigen::MatrixXi &word_ids) const
 
void GetImageIds (std::unordered_set< int > *image_ids) const
 
void Read (std::ifstream *ifs)
 
void Write (std::ofstream *ofs) const
 

Static Public Attributes

static const int kInvalidWordId
 

Detailed Description

template<typename kDescType, int kDescDim, int kEmbeddingDim>
class colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >

Definition at line 31 of file inverted_index.h.

Member Typedef Documentation

◆ DescType

template<typename kDescType , int kDescDim, int kEmbeddingDim>
typedef Eigen::Matrix<kDescType, Eigen::Dynamic, kDescDim, Eigen::RowMajor> colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::DescType

Definition at line 35 of file inverted_index.h.

◆ EntryType

template<typename kDescType , int kDescDim, int kEmbeddingDim>
typedef InvertedFile<kEmbeddingDim>::EntryType colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::EntryType

Definition at line 36 of file inverted_index.h.

◆ GeomType

template<typename kDescType , int kDescDim, int kEmbeddingDim>
typedef InvertedFile<kEmbeddingDim>::GeomType colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::GeomType

Definition at line 37 of file inverted_index.h.

◆ ProjDescType

template<typename kDescType , int kDescDim, int kEmbeddingDim>
typedef Eigen::VectorXf colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ProjDescType

Definition at line 39 of file inverted_index.h.

◆ ProjMatrixType

template<typename kDescType , int kDescDim, int kEmbeddingDim>
typedef Eigen::Matrix<float, Eigen::Dynamic, kDescDim> colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ProjMatrixType

Definition at line 38 of file inverted_index.h.

Constructor & Destructor Documentation

◆ InvertedIndex()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::InvertedIndex

Definition at line 122 of file inverted_index.h.

Member Function Documentation

◆ AddEntry()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::AddEntry ( const int  image_id,
const int  word_id,
typename DescType::Index  feature_idx,
const DescType descriptor,
const GeomType geometry 
)

Definition at line 200 of file inverted_index.h.

◆ ClearEntries()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ClearEntries

Definition at line 214 of file inverted_index.h.

◆ ComputeHammingEmbedding()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ComputeHammingEmbedding ( const DescType descriptors,
const Eigen::VectorXi &  word_ids 
)

Definition at line 165 of file inverted_index.h.

References descriptors.

◆ ComputeSelfSimilarity()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
float colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ComputeSelfSimilarity ( const Eigen::MatrixXi &  word_ids) const

Definition at line 309 of file inverted_index.h.

◆ ConvertToBinaryDescriptor()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::ConvertToBinaryDescriptor ( const int  word_id,
const DescType descriptor,
std::bitset< kEmbeddingDim > *  binary_descriptor 
) const

Definition at line 277 of file inverted_index.h.

◆ Finalize()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::Finalize

Definition at line 143 of file inverted_index.h.

◆ FindMatches()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::FindMatches ( const int  word_id,
const std::unordered_set< int > &  image_ids,
std::vector< const EntryType * > *  matches 
) const

Definition at line 295 of file inverted_index.h.

◆ GenerateHammingEmbeddingProjection()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::GenerateHammingEmbeddingProjection

Definition at line 154 of file inverted_index.h.

References colmap::RandomGaussian().

◆ GetIDFWeight()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
float colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::GetIDFWeight ( const int  word_id) const

Definition at line 289 of file inverted_index.h.

◆ GetImageIds()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::GetImageIds ( std::unordered_set< int > *  image_ids) const

Definition at line 324 of file inverted_index.h.

◆ Initialize()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::Initialize ( const int  num_words)

Definition at line 133 of file inverted_index.h.

◆ NumVisualWords()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
int colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::NumVisualWords

Definition at line 128 of file inverted_index.h.

◆ Query()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::Query ( const DescType descriptors,
const Eigen::MatrixXi &  word_ids,
std::vector< ImageScore > *  image_scores 
) const

Definition at line 221 of file inverted_index.h.

References descriptors.

◆ Read()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::Read ( std::ifstream *  ifs)

Definition at line 332 of file inverted_index.h.

◆ Write()

template<typename kDescType , int kDescDim, int kEmbeddingDim>
void colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::Write ( std::ofstream *  ofs) const

Definition at line 375 of file inverted_index.h.

References float.

Member Data Documentation

◆ kInvalidWordId

template<typename kDescType , int kDescDim, int kEmbeddingDim>
const int colmap::retrieval::InvertedIndex< kDescType, kDescDim, kEmbeddingDim >::kInvalidWordId
static
Initial value:
=
std::numeric_limits<int>::max()

Definition at line 33 of file inverted_index.h.


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