OpenCV  4.1.1-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
cvflann::lsh::LshTable< ElementType > Class Template Reference

Lsh hash table. More...

#include <opencv2/flann/lsh_table.h>

Public Types

typedef std::map< BucketKey, BucketBucketsSpace
 A container of all the feature indices. More...
 
typedef std::vector< BucketBucketsSpeed
 A container of all the feature indices. More...
 

Public Member Functions

 LshTable ()
 Default constructor. More...
 
 LshTable (unsigned int feature_size, unsigned int key_size)
 Default constructor Create the mask and allocate the memory. More...
 
template<>
 LshTable (unsigned int feature_size, unsigned int subsignature_size)
 
void add (unsigned int value, const ElementType *feature)
 Add a feature to the table. More...
 
void add (Matrix< ElementType > dataset)
 Add a set of features to the table. More...
 
const BucketgetBucketFromKey (BucketKey key) const
 Get a bucket given the key. More...
 
size_t getKey (const ElementType *) const
 Compute the sub-signature of a feature. More...
 
template<>
size_t getKey (const unsigned char *feature) const
 Return the Subsignature of a feature. More...
 
LshStats getStats () const
 Get statistics about the table. More...
 
template<>
LshStats getStats () const
 

Detailed Description

template<typename ElementType>
class cvflann::lsh::LshTable< ElementType >

Lsh hash table.

As its key is a sub-feature, and as usually the size of it is pretty small, we keep it as a continuous memory array. The value is an index in the corpus of features (we keep it as an unsigned int for pure memory reasons, it could be a size_t)

Member Typedef Documentation

◆ BucketsSpace

template<typename ElementType>
typedef std::map<BucketKey, Bucket> cvflann::lsh::LshTable< ElementType >::BucketsSpace

A container of all the feature indices.

Optimized for space

◆ BucketsSpeed

template<typename ElementType>
typedef std::vector<Bucket> cvflann::lsh::LshTable< ElementType >::BucketsSpeed

A container of all the feature indices.

Optimized for speed

Constructor & Destructor Documentation

◆ LshTable() [1/3]

template<typename ElementType>
cvflann::lsh::LshTable< ElementType >::LshTable ( )
inline

Default constructor.

◆ LshTable() [2/3]

template<typename ElementType>
cvflann::lsh::LshTable< ElementType >::LshTable ( unsigned int  feature_size,
unsigned int  key_size 
)
inline

Default constructor Create the mask and allocate the memory.

Parameters
feature_sizeis the size of the feature (considered as a ElementType[])
key_sizeis the number of bits that are turned on in the feature

◆ LshTable() [3/3]

template<>
cvflann::lsh::LshTable< unsigned char >::LshTable ( unsigned int  feature_size,
unsigned int  subsignature_size 
)
inline

References cv::randShuffle().

Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

template<typename ElementType>
void cvflann::lsh::LshTable< ElementType >::add ( unsigned int  value,
const ElementType *  feature 
)
inline

Add a feature to the table.

Parameters
valuethe value to store for that feature
featurethe feature itself

Referenced by cvflann::LshIndex< Distance >::buildIndex().

Here is the caller graph for this function:

◆ add() [2/2]

template<typename ElementType>
void cvflann::lsh::LshTable< ElementType >::add ( Matrix< ElementType >  dataset)
inline

Add a set of features to the table.

Parameters
datasetthe values to store

References cv::add(), and cvflann::Matrix< T >::rows.

Here is the call graph for this function:

◆ getBucketFromKey()

template<typename ElementType>
const Bucket* cvflann::lsh::LshTable< ElementType >::getBucketFromKey ( BucketKey  key) const
inline

Get a bucket given the key.

Parameters
key
Returns

◆ getKey() [1/2]

template<typename ElementType>
size_t cvflann::lsh::LshTable< ElementType >::getKey ( const ElementType *  ) const
inline

Compute the sub-signature of a feature.

References CV_Error, cv::max(), cv::min(), and cv::Error::StsBadArg.

Here is the call graph for this function:

◆ getKey() [2/2]

template<>
size_t cvflann::lsh::LshTable< unsigned char >::getKey ( const unsigned char *  feature) const
inline

Return the Subsignature of a feature.

Parameters
featurethe feature to analyze

◆ getStats() [1/2]

template<typename ElementType>
LshStats cvflann::lsh::LshTable< ElementType >::getStats ( ) const

Get statistics about the table.

Returns

◆ getStats() [2/2]


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