cvflann Namespace Reference

Classes

class  AutotunedIndex
struct  AutotunedIndexParams
struct  BranchStruct
class  CompositeIndex
struct  CompositeIndexParams
struct  Datatype
struct  Datatype< char >
struct  Datatype< double >
struct  Datatype< float >
struct  Datatype< int >
struct  Datatype< short >
struct  Datatype< unsigned char >
struct  Datatype< unsigned int >
struct  Datatype< unsigned short >
class  Heap
struct  IndexHeader
class  KDTreeIndex
struct  KDTreeIndexParams
class  KMeansIndex
struct  KMeansIndexParams
class  KNNResultSet
class  LinearIndex
struct  LinearIndexParams
class  Logger
class  Matrix
class  NNIndex
class  ObjectFactory
class  PooledAllocator
class  RadiusResultSet
class  ResultSet
class  StartStopTimer
class  UniqueRandom
class  UntypedMatrix
struct  ZeroIterator

Functions

template<typename T >
void addValue (int pos, float val, float *vals, T *point, T *points, int n)
template<typename T >
T * allocate (size_t count=1)
template<typename Iterator1 , typename Iterator2 >
double chi_square_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename T >
void compute_ground_truth (const Matrix< T > &dataset, const Matrix< T > &testset, Matrix< int > &matches, int skip=0)
template<typename ELEM_TYPE >
float computeDistanceRaport (const Matrix< ELEM_TYPE > &inputData, ELEM_TYPE *target, int *neighbors, int *groundTruth, int veclen, int n)
CV_EXPORTS int countCorrectMatches (int *neighbors, int *groundTruth, int n)
template<typename T >
NNIndex< T > * create_index_by_type (const Matrix< T > &dataset, const IndexParams &params)
template<typename BaseClass , typename DerivedClass >
BaseClass * createObject ()
template<typename Iterator1 , typename Iterator2 >
double custom_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
CV_EXPORTS double euclidean_dist (const unsigned char *first1, const unsigned char *last1, unsigned char *first2, double acc)
template<typename Iterator1 , typename Iterator2 >
double euclidean_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename T >
void find_nearest (const Matrix< T > &dataset, T *query, int *matches, int nn, int skip=0)
CV_EXPORTS flann_distance_t flann_distance_type ()
CV_EXPORTS int flann_minkowski_order ()
CV_EXPORTS const char * FLANN_SIGNATURE ()
CV_EXPORTS const char * FLANN_VERSION ()
template<typename Iterator1 , typename Iterator2 >
double hellinger_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename Iterator1 , typename Iterator2 >
double hist_intersection_dist_sq (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename Iterator1 , typename Iterator2 >
double hist_intersection_kernel (Iterator1 first1, Iterator1 last1, Iterator2 first2)
template<typename Iterator1 , typename Iterator2 >
double kl_divergence (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename T >
void load_from_file (cvflann::Matrix< T > &flann_dataset, const std::string &filename, const std::string &name)
CV_EXPORTS IndexHeader load_header (FILE *stream)
template<typename T >
void load_value (FILE *stream, T &value, int count=1)
CV_EXPORTS Loggerlogger ()
template<typename Iterator1 , typename Iterator2 >
double manhattan_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename Iterator1 , typename Iterator2 >
double max_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename Iterator1 , typename Iterator2 >
double minkowski_dist (Iterator1 first1, Iterator1 last1, Iterator2 first2, double acc=0)
template<typename T , typename F >
float optimizeSimplexDownhill (T *points, int n, F func, float *vals=NULL)
CV_EXPORTS double rand_double (double high=1.0, double low=0)
CV_EXPORTS int rand_int (int high=RAND_MAX, int low=0)
template<typename T >
Matrix< T > random_sample (const Matrix< T > &srcMatrix, size_t size)
template<typename T >
Matrix< T > random_sample (Matrix< T > &srcMatrix, long size, bool remove=false)
template<typename ELEM_TYPE >
void save_header (FILE *stream, const NNIndex< ELEM_TYPE > &index)
template<typename T >
void save_to_file (const cvflann::Matrix< T > &flann_dataset, const std::string &filename, const std::string &name)
template<typename T >
void save_value (FILE *stream, const T &value, int count=1)
template<typename ELEM_TYPE >
float search_with_ground_truth (NNIndex< ELEM_TYPE > &index, const Matrix< ELEM_TYPE > &inputData, const Matrix< ELEM_TYPE > &testData, const Matrix< int > &matches, int nn, int checks, float &time, float &dist, int skipMatches)
CV_EXPORTS void seed_random (unsigned int seed)
template<typename ELEM_TYPE >
float test_index_checks (NNIndex< ELEM_TYPE > &index, const Matrix< ELEM_TYPE > &inputData, const Matrix< ELEM_TYPE > &testData, const Matrix< int > &matches, int checks, float &precision, int nn=1, int skipMatches=0)
template<typename ELEM_TYPE >
float test_index_precision (NNIndex< ELEM_TYPE > &index, const Matrix< ELEM_TYPE > &inputData, const Matrix< ELEM_TYPE > &testData, const Matrix< int > &matches, float precision, int &checks, int nn=1, int skipMatches=0)
template<typename ELEM_TYPE >
float test_index_precisions (NNIndex< ELEM_TYPE > &index, const Matrix< ELEM_TYPE > &inputData, const Matrix< ELEM_TYPE > &testData, const Matrix< int > &matches, float *precisions, int precisions_length, int nn=1, int skipMatches=0, float maxTime=0)
CV_EXPORTS ZeroIterator< float > & zero ()

Variables

const size_t BLOCKSIZE = 8192
const size_t WORDSIZE = 16

Function Documentation

template<typename T >
void cvflann::addValue ( int  pos,
float  val,
float *  vals,
T *  point,
T *  points,
int  n 
) [inline]

Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.

Definition at line 41 of file simplex_downhill.h.

template<typename T >
T* cvflann::allocate ( size_t  count = 1  )  [inline]

Allocates (using C's malloc) a generic type T.

Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer

Definition at line 48 of file allocator.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::chi_square_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Definition at line 257 of file dist.h.

template<typename T >
void cvflann::compute_ground_truth ( const Matrix< T > &  dataset,
const Matrix< T > &  testset,
Matrix< int > &  matches,
int  skip = 0 
) [inline]

Definition at line 85 of file ground_truth.h.

template<typename ELEM_TYPE >
float cvflann::computeDistanceRaport ( const Matrix< ELEM_TYPE > &  inputData,
ELEM_TYPE *  target,
int *  neighbors,
int *  groundTruth,
int  veclen,
int  n 
) [inline]

Definition at line 53 of file index_testing.h.

CV_EXPORTS int cvflann::countCorrectMatches ( int *  neighbors,
int *  groundTruth,
int  n 
)
template<typename T >
NNIndex<T>* cvflann::create_index_by_type ( const Matrix< T > &  dataset,
const IndexParams &  params 
) [inline]

Definition at line 44 of file all_indices.h.

template<typename BaseClass , typename DerivedClass >
BaseClass* cvflann::createObject (  )  [inline]

Definition at line 41 of file object_factory.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::custom_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Custom distance function. The distance computed is dependent on the value of the 'flann_distance_type' global variable.

If the last argument 'acc' is passed, the result is accumulated to the value of this argument.

Definition at line 305 of file dist.h.

CV_EXPORTS double cvflann::euclidean_dist ( const unsigned char *  first1,
const unsigned char *  last1,
unsigned char *  first2,
double  acc 
)
template<typename Iterator1 , typename Iterator2 >
double cvflann::euclidean_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Compute the squared Euclidean distance between two vectors.

This is highly optimised, with loop unrolling, as it is one of the most expensive inner loops.

The computation of squared root at the end is omitted for efficiency.

Definition at line 61 of file dist.h.

template<typename T >
void cvflann::find_nearest ( const Matrix< T > &  dataset,
T *  query,
int *  matches,
int  nn,
int  skip = 0 
) [inline]

Definition at line 41 of file ground_truth.h.

CV_EXPORTS flann_distance_t cvflann::flann_distance_type (  ) 
CV_EXPORTS int cvflann::flann_minkowski_order (  ) 
CV_EXPORTS const char* cvflann::FLANN_SIGNATURE (  ) 
CV_EXPORTS const char* cvflann::FLANN_VERSION (  ) 
template<typename Iterator1 , typename Iterator2 >
double cvflann::hellinger_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Definition at line 230 of file dist.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::hist_intersection_dist_sq ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Definition at line 216 of file dist.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::hist_intersection_kernel ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2 
) [inline]

Definition at line 189 of file dist.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::kl_divergence ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Definition at line 276 of file dist.h.

template<typename T >
void cvflann::load_from_file ( cvflann::Matrix< T > &  flann_dataset,
const std::string &  filename,
const std::string &  name 
) [inline]

Definition at line 119 of file hdf5.h.

CV_EXPORTS IndexHeader cvflann::load_header ( FILE *  stream  ) 
Parameters:
stream - Stream to load from
Returns:
Index header
template<typename T >
void cvflann::load_value ( FILE *  stream,
T &  value,
int  count = 1 
) [inline]

Definition at line 105 of file saving.h.

CV_EXPORTS Logger& cvflann::logger (  ) 
template<typename Iterator1 , typename Iterator2 >
double cvflann::manhattan_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Compute the Manhattan (L_1) distance between two vectors.

This is highly optimised, with loop unrolling, as it is one of the most expensive inner loops.

Definition at line 95 of file dist.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::max_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Definition at line 160 of file dist.h.

template<typename Iterator1 , typename Iterator2 >
double cvflann::minkowski_dist ( Iterator1  first1,
Iterator1  last1,
Iterator2  first2,
double  acc = 0 
) [inline]

Compute the Minkowski (L_p) distance between two vectors.

This is highly optimised, with loop unrolling, as it is one of the most expensive inner loops.

The computation of squared root at the end is omitted for efficiency.

Definition at line 131 of file dist.h.

template<typename T , typename F >
float cvflann::optimizeSimplexDownhill ( T *  points,
int  n,
func,
float *  vals = NULL 
) [inline]

Simplex downhill optimization function. Preconditions: points is a 2D mattrix of size (n+1) x n func is the cost function taking n an array of n params and returning float vals is the cost function in the n+1 simplex points, if NULL it will be computed

Postcondition: returns optimum value and points[0..n] are the optimum parameters

Definition at line 69 of file simplex_downhill.h.

CV_EXPORTS double cvflann::rand_double ( double  high = 1.0,
double  low = 0 
)
CV_EXPORTS int cvflann::rand_int ( int  high = RAND_MAX,
int  low = 0 
)
template<typename T >
Matrix<T> cvflann::random_sample ( const Matrix< T > &  srcMatrix,
size_t  size 
) [inline]

Definition at line 74 of file sampling.h.

template<typename T >
Matrix<T> cvflann::random_sample ( Matrix< T > &  srcMatrix,
long  size,
bool  remove = false 
) [inline]

Definition at line 42 of file sampling.h.

template<typename ELEM_TYPE >
void cvflann::save_header ( FILE *  stream,
const NNIndex< ELEM_TYPE > &  index 
) [inline]

Saves index header to stream

Parameters:
stream - Stream to save to
index - The index to save

Definition at line 73 of file saving.h.

template<typename T >
void cvflann::save_to_file ( const cvflann::Matrix< T > &  flann_dataset,
const std::string &  filename,
const std::string &  name 
) [inline]

Definition at line 71 of file hdf5.h.

template<typename T >
void cvflann::save_value ( FILE *  stream,
const T &  value,
int  count = 1 
) [inline]

Definition at line 98 of file saving.h.

template<typename ELEM_TYPE >
float cvflann::search_with_ground_truth ( NNIndex< ELEM_TYPE > &  index,
const Matrix< ELEM_TYPE > &  inputData,
const Matrix< ELEM_TYPE > &  testData,
const Matrix< int > &  matches,
int  nn,
int  checks,
float &  time,
float &  dist,
int  skipMatches 
) [inline]

Definition at line 73 of file index_testing.h.

CV_EXPORTS void cvflann::seed_random ( unsigned int  seed  ) 

Seeds the random number generator

template<typename ELEM_TYPE >
float cvflann::test_index_checks ( NNIndex< ELEM_TYPE > &  index,
const Matrix< ELEM_TYPE > &  inputData,
const Matrix< ELEM_TYPE > &  testData,
const Matrix< int > &  matches,
int  checks,
float &  precision,
int  nn = 1,
int  skipMatches = 0 
) [inline]

Definition at line 120 of file index_testing.h.

template<typename ELEM_TYPE >
float cvflann::test_index_precision ( NNIndex< ELEM_TYPE > &  index,
const Matrix< ELEM_TYPE > &  inputData,
const Matrix< ELEM_TYPE > &  testData,
const Matrix< int > &  matches,
float  precision,
int &  checks,
int  nn = 1,
int  skipMatches = 0 
) [inline]

Definition at line 134 of file index_testing.h.

template<typename ELEM_TYPE >
float cvflann::test_index_precisions ( NNIndex< ELEM_TYPE > &  index,
const Matrix< ELEM_TYPE > &  inputData,
const Matrix< ELEM_TYPE > &  testData,
const Matrix< int > &  matches,
float *  precisions,
int  precisions_length,
int  nn = 1,
int  skipMatches = 0,
float  maxTime = 0 
) [inline]

Definition at line 204 of file index_testing.h.

CV_EXPORTS ZeroIterator<float>& cvflann::zero (  ) 

Variable Documentation

const size_t cvflann::BLOCKSIZE = 8192

Definition at line 71 of file allocator.h.

const size_t cvflann::WORDSIZE = 16

Pooled storage allocator

The following routines allow for the efficient allocation of storage in small chunks from a specified pool. Rather than allowing each structure to be freed individually, an entire pool of storage is freed at once. This method has two advantages over just using malloc() and free(). First, it is far more efficient for allocating small objects, as there is no overhead for remembering all the information needed to free each object or consolidating fragmented memory. Second, the decision about how long to keep an object is made at the time of allocation, and there is no need to track down all the objects to free them.

Definition at line 70 of file allocator.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


opencv2
Author(s): Gary Bradski and many others. See web page for a full contributor list. ROS package maintained by James Bowman.
autogenerated on Fri Jan 11 10:00:49 2013