opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

LshTable< ElementType > Class Template Reference

LshTable< ElementType > Class Template Reference

Lsh hash table. More...

#include <lsh_table.h>

Public Types

typedef std::unordered_map
< BucketKey, Bucket > 
BucketsSpace
 A container of all the feature indices.
typedef std::vector< Bucket > BucketsSpeed
 A container of all the feature indices.

Public Member Functions

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

Definition at line 130 of file lsh_table.h.


Member Typedef Documentation

typedef std::unordered_map<BucketKey, Bucket> BucketsSpace

A container of all the feature indices.

Optimized for space

Definition at line 136 of file lsh_table.h.

typedef std::vector<Bucket> BucketsSpeed

A container of all the feature indices.

Optimized for speed

Definition at line 143 of file lsh_table.h.


Constructor & Destructor Documentation

LshTable (  )

Default constructor.

Definition at line 147 of file lsh_table.h.

LshTable ( unsigned int  feature_size,
unsigned int  key_size 
)

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

Definition at line 156 of file lsh_table.h.


Member Function Documentation

void add ( unsigned int  value,
const ElementType *  feature 
)

Add a feature to the table.

Parameters:
valuethe value to store for that feature
featurethe feature itself

Definition at line 168 of file lsh_table.h.

void add ( Matrix< ElementType >  dataset )

Add a set of features to the table.

Parameters:
datasetthe values to store

Definition at line 195 of file lsh_table.h.

const Bucket* getBucketFromKey ( BucketKey  key ) const

Get a bucket given the key.

Parameters:
key
Returns:

Definition at line 210 of file lsh_table.h.

size_t getKey ( const ElementType *   ) const

Compute the sub-signature of a feature.

Definition at line 239 of file lsh_table.h.

size_t getKey ( const unsigned char *  feature ) const
Parameters:
featurethe feature to analyze

Definition at line 385 of file lsh_table.h.

LshStats getStats (  ) const

Get statistics about the table.

Returns: