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 >:
[legend]

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

const static int kInvalidWordId
 

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

◆ EntryType

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

◆ GeomType

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

◆ ProjDescType

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

◆ ProjMatrixType

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

Constructor & Destructor Documentation

◆ InvertedIndex()

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

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 
)

◆ ClearEntries()

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

◆ ComputeHammingEmbedding()

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

◆ ComputeSelfSimilarity()

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

◆ 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

◆ Finalize()

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

◆ 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

◆ GenerateHammingEmbeddingProjection()

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

◆ GetIDFWeight()

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

◆ GetImageIds()

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

◆ Initialize()

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

◆ NumVisualWords()

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

◆ 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

◆ Read()

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

◆ Write()

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

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()

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