Lsh hash table. More...
#include <opencv2/flann/lsh_table.h>
Public Types | |
typedef std::map< BucketKey, Bucket > | BucketsSpace |
A container of all the feature indices. More... | |
typedef std::vector< Bucket > | BucketsSpeed |
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 Bucket * | getBucketFromKey (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 |
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)
typedef std::map<BucketKey, Bucket> cvflann::lsh::LshTable< ElementType >::BucketsSpace |
A container of all the feature indices.
Optimized for space
typedef std::vector<Bucket> cvflann::lsh::LshTable< ElementType >::BucketsSpeed |
A container of all the feature indices.
Optimized for speed
|
inline |
Default constructor.
|
inline |
Default constructor Create the mask and allocate the memory.
feature_size | is the size of the feature (considered as a ElementType[]) |
key_size | is the number of bits that are turned on in the feature |
|
inline |
|
inline |
Add a feature to the table.
value | the value to store for that feature |
feature | the feature itself |
Referenced by cvflann::LshIndex< Distance >::buildIndex().
|
inline |
Add a set of features to the table.
dataset | the values to store |
References cv::add(), and cvflann::Matrix< T >::rows.
|
inline |
Get a bucket given the key.
key |
|
inline |
Compute the sub-signature of a feature.
References CV_Error, cv::max(), cv::min(), and cv::Error::StsBadArg.
|
inline |
Return the Subsignature of a feature.
feature | the feature to analyze |
LshStats cvflann::lsh::LshTable< ElementType >::getStats | ( | ) | const |
Get statistics about the table.
|
inline |
References cvflann::lsh::LshStats::bucket_size_max_, cvflann::lsh::LshStats::bucket_size_mean_, cvflann::lsh::LshStats::bucket_size_median_, cvflann::lsh::LshStats::bucket_size_min_, cvflann::lsh::LshStats::bucket_sizes_, cvflann::lsh::LshStats::n_buckets_, cvflann::lsh::LshStats::size_histogram_, and cv::sort().