Namespaces | |
anyimpl | |
lsh | |
Classes | |
struct | Accumulator |
struct | Accumulator< char > |
struct | Accumulator< int > |
struct | Accumulator< short > |
struct | Accumulator< unsigned char > |
struct | Accumulator< unsigned int > |
struct | Accumulator< unsigned short > |
struct | any |
class | AutotunedIndex |
struct | AutotunedIndexParams |
struct | BranchStruct |
struct | ChiSquareDistance |
class | CompositeIndex |
This index builds a kd-tree index and a k-means index and performs nearest neighbour search both indexes. More... | |
struct | CompositeIndexParams |
Index parameters for the CompositeIndex. More... | |
class | CreatorNotFound |
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 | DynamicBitset |
Class re-implementing the boost version of it This helps not depending on boost, it also does not do the bound checks and has a way to reset a block for speed. More... | |
class | False |
class | FLANNException |
struct | Hamming |
Hamming distance functor (pop count between two binary vectors, i.e. More... | |
struct | Hamming2 |
struct | HammingLUT |
Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor bit count of A exclusive XOR'ed with B. More... | |
class | Heap |
Priority Queue Implementation. More... | |
struct | HellingerDistance |
class | HierarchicalClusteringIndex |
Hierarchical index. More... | |
struct | HierarchicalClusteringIndexParams |
struct | HistIntersectionDistance |
class | Index |
struct | index_creator |
struct | index_creator< False, False, Distance > |
struct | index_creator< False, VectorSpace, Distance > |
struct | IndexHeader |
Structure representing the index header. More... | |
class | KDTreeIndex |
Randomized kd-tree index. More... | |
struct | KDTreeIndexParams |
class | KDTreeSingleIndex |
Randomized kd-tree index. More... | |
struct | KDTreeSingleIndexParams |
struct | KL_Divergence |
class | KMeansIndex |
Hierarchical kmeans index. More... | |
struct | KMeansIndexParams |
class | KNNRadiusUniqueResultSet |
Class that holds the k NN neighbors within a radius distance. More... | |
class | KNNResultSet |
K-Nearest neighbour result set. More... | |
class | KNNSimpleResultSet |
KNNSimpleResultSet does not ensure that the element it holds are unique. More... | |
class | KNNUniqueResultSet |
Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays. More... | |
struct | L1 |
struct | L2 |
Squared Euclidean distance functor, optimized version. More... | |
struct | L2_Simple |
Squared Euclidean distance functor. More... | |
class | LinearIndex |
struct | LinearIndexParams |
class | Logger |
class | LshIndex |
Randomized kd-tree index. More... | |
struct | LshIndexParams |
class | Matrix |
Class that implements a simple rectangular matrix stored in a memory buffer and provides convenient matrix-like access using the [] operators. More... | |
struct | MaxDistance |
struct | MinkowskiDistance |
class | NNIndex |
Nearest-neighbour index base class. More... | |
class | ObjectFactory |
class | PooledAllocator |
class | RadiusResultSet |
A result-set class used when performing a radius based search. More... | |
class | RadiusUniqueResultSet |
Class that holds the radius nearest neighbors It is more accurate than RadiusResult as it is not limited in the number of neighbors. More... | |
class | ResultSet |
struct | SavedIndexParams |
(Deprecated) Index parameters for creating a saved index. More... | |
struct | SearchParams |
struct | simpleDistance |
struct | simpleDistance< ChiSquareDistance< ElementType >, ElementType > |
struct | simpleDistance< HellingerDistance< ElementType >, ElementType > |
struct | simpleDistance< L2< ElementType >, ElementType > |
struct | simpleDistance< L2_Simple< ElementType >, ElementType > |
struct | simpleDistance< MinkowskiDistance< ElementType >, ElementType > |
struct | squareDistance |
struct | squareDistance< ChiSquareDistance< ElementType >, ElementType > |
struct | squareDistance< HellingerDistance< ElementType >, ElementType > |
struct | squareDistance< L2< ElementType >, ElementType > |
struct | squareDistance< L2_Simple< ElementType >, ElementType > |
struct | squareDistance< MinkowskiDistance< ElementType >, ElementType > |
class | StartStopTimer |
A start-stop timer class. More... | |
class | True |
class | UniqueRandom |
Random number generator that returns a distinct number from the [0,n) interval each time. More... | |
class | UniqueResultSet |
Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays. More... | |
class | UntypedMatrix |
struct | ZeroIterator |
Typedefs | |
typedef std::map< cv::String, any > | IndexParams |
Functions | |
template<typename T > | |
T | abs (T x) |
template<> | |
double | abs< double > (double x) |
template<> | |
float | abs< float > (float x) |
template<typename T > | |
void | addValue (int pos, float val, float *vals, T *point, T *points, int n) |
Adds val to array vals (and point to array points) and keeping the arrays sorted by vals. More... | |
template<typename T > | |
T * | allocate (size_t count=1) |
Allocates (using C's malloc) a generic type T. More... | |
template<typename Distance > | |
void | compute_ground_truth (const Matrix< typename Distance::ElementType > &dataset, const Matrix< typename Distance::ElementType > &testset, Matrix< int > &matches, int skip=0, Distance d=Distance()) |
template<typename Distance > | |
Distance::ResultType | computeDistanceRaport (const Matrix< typename Distance::ElementType > &inputData, typename Distance::ElementType *target, int *neighbors, int *groundTruth, int veclen, int n, const Distance &distance) |
int | countCorrectMatches (int *neighbors, int *groundTruth, int n) |
template<typename Distance > | |
NNIndex< Distance > * | create_index_by_type (const Matrix< typename Distance::ElementType > &dataset, const IndexParams ¶ms, const Distance &distance) |
void | dummyfunc () |
template<typename Distance > | |
Distance::ResultType | ensureSimpleDistance (typename Distance::ResultType dist) |
template<typename Distance > | |
Distance::ResultType | ensureSquareDistance (typename Distance::ResultType dist) |
template<typename Distance > | |
void | find_nearest (const Matrix< typename Distance::ElementType > &dataset, typename Distance::ElementType *query, int *matches, int nn, int skip=0, Distance distance=Distance()) |
flann_distance_t | flann_distance_type () |
template<typename T > | |
T | get_param (const IndexParams ¶ms, cv::String name, const T &default_value) |
template<typename T > | |
T | get_param (const IndexParams ¶ms, cv::String name) |
template<typename Distance > | |
int | hierarchicalClustering (const Matrix< typename Distance::ElementType > &points, Matrix< typename Distance::ResultType > ¢ers, const KMeansIndexParams ¶ms, Distance d=Distance()) |
Performs a hierarchical clustering of the points passed as argument and then takes a cut in the the clustering tree to return a flat clustering. More... | |
IndexHeader | load_header (FILE *stream) |
template<typename Distance > | |
NNIndex< Distance > * | load_saved_index (const Matrix< typename Distance::ElementType > &dataset, const cv::String &filename, Distance distance) |
template<typename T > | |
void | load_value (FILE *stream, T &value, size_t count=1) |
template<typename T > | |
void | load_value (FILE *stream, cvflann::Matrix< T > &value) |
template<typename T > | |
void | load_value (FILE *stream, std::vector< T > &value) |
void | log_verbosity (int level) |
Sets the log level used for all flann functions. More... | |
std::ostream & | operator<< (std::ostream &out, const any &any_val) |
template<typename T , typename F > | |
float | optimizeSimplexDownhill (T *points, int n, F func, float *vals=NULL) |
Simplex downhill optimization function. More... | |
void | print_params (const IndexParams ¶ms, std::ostream &stream) |
void | print_params (const IndexParams ¶ms) |
int | rand () |
double | rand_double (double high=1.0, double low=0) |
Generates a random double value. More... | |
int | rand_int (int high=RAND_MAX, int low=0) |
Generates a random integer value. More... | |
template<typename T > | |
Matrix< T > | random_sample (Matrix< T > &srcMatrix, long size, bool remove=false) |
template<typename T > | |
Matrix< T > | random_sample (const Matrix< T > &srcMatrix, size_t size) |
template<typename Distance > | |
void | save_header (FILE *stream, const NNIndex< Distance > &index) |
Saves index header to stream. More... | |
template<typename T > | |
void | save_value (FILE *stream, const T &value, size_t count=1) |
template<typename T > | |
void | save_value (FILE *stream, const cvflann::Matrix< T > &value) |
template<typename T > | |
void | save_value (FILE *stream, const std::vector< T > &value) |
template<typename Distance > | |
float | search_with_ground_truth (NNIndex< Distance > &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< int > &matches, int nn, int checks, float &time, typename Distance::ResultType &dist, const Distance &distance, int skipMatches) |
void | seed_random (unsigned int seed) |
Seeds the random number generator. More... | |
void | set_distance_type (flann_distance_t distance_type, int order) |
template<typename Distance > | |
float | test_index_checks (NNIndex< Distance > &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< int > &matches, int checks, float &precision, const Distance &distance, int nn=1, int skipMatches=0) |
template<typename Distance > | |
float | test_index_precision (NNIndex< Distance > &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< int > &matches, float precision, int &checks, const Distance &distance, int nn=1, int skipMatches=0) |
template<typename Distance > | |
void | test_index_precisions (NNIndex< Distance > &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< int > &matches, float *precisions, int precisions_length, const Distance &distance, int nn=1, int skipMatches=0, float maxTime=0) |
Variables | |
const size_t | BLOCKSIZE =8192 |
const size_t | WORDSIZE =16 |
Pooled storage allocator. More... | |
typedef std::map<cv::String, any> cvflann::IndexParams |
|
inline |
References cv::abs().
Referenced by cvflann::L1< T >::accum_dist(), cvflann::MinkowskiDistance< T >::accum_dist(), cvflann::L1< T >::operator()(), cvflann::MinkowskiDistance< T >::operator()(), and cvflann::MaxDistance< T >::operator()().
|
inline |
|
inline |
void cvflann::addValue | ( | int | pos, |
float | val, | ||
float * | vals, | ||
T * | point, | ||
T * | points, | ||
int | n | ||
) |
Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.
References cv::swap().
Referenced by optimizeSimplexDownhill().
T* cvflann::allocate | ( | size_t | count = 1 | ) |
Allocates (using C's malloc) a generic type T.
Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer
void cvflann::compute_ground_truth | ( | const Matrix< typename Distance::ElementType > & | dataset, |
const Matrix< typename Distance::ElementType > & | testset, | ||
Matrix< int > & | matches, | ||
int | skip = 0 , |
||
Distance | d = Distance() |
||
) |
References cvflann::Matrix< T >::rows.
Distance::ResultType cvflann::computeDistanceRaport | ( | const Matrix< typename Distance::ElementType > & | inputData, |
typename Distance::ElementType * | target, | ||
int * | neighbors, | ||
int * | groundTruth, | ||
int | veclen, | ||
int | n, | ||
const Distance & | distance | ||
) |
|
inline |
NNIndex< Distance > * cvflann::create_index_by_type | ( | const Matrix< typename Distance::ElementType > & | dataset, |
const IndexParams & | params, | ||
const Distance & | distance | ||
) |
References cvflann::index_creator< KDTreeCapability, VectorSpace, Distance >::create().
Referenced by cvflann::AutotunedIndex< Distance >::buildIndex().
|
inline |
Distance::ResultType cvflann::ensureSimpleDistance | ( | typename Distance::ResultType | dist | ) |
Distance::ResultType cvflann::ensureSquareDistance | ( | typename Distance::ResultType | dist | ) |
void cvflann::find_nearest | ( | const Matrix< typename Distance::ElementType > & | dataset, |
typename Distance::ElementType * | query, | ||
int * | matches, | ||
int | nn, | ||
int | skip = 0 , |
||
Distance | distance = Distance() |
||
) |
References cvflann::Matrix< T >::cols, cvflann::Matrix< T >::rows, and cv::swap().
flann_distance_t cvflann::flann_distance_type | ( | ) |
Referenced by cv::flann::hierarchicalClustering(), and cv::flann::Index_< T >::Index_().
T cvflann::get_param | ( | const IndexParams & | params, |
cv::String | name, | ||
const T & | default_value | ||
) |
Referenced by cvflann::AutotunedIndex< Distance >::AutotunedIndex(), cvflann::KDTreeIndex< Distance >::findNeighbors(), cvflann::KDTreeSingleIndex< Distance >::findNeighbors(), cvflann::KMeansIndex< Distance >::findNeighbors(), cvflann::HierarchicalClusteringIndex< Distance >::findNeighbors(), cvflann::HierarchicalClusteringIndex< Distance >::HierarchicalClusteringIndex(), cvflann::KDTreeIndex< Distance >::KDTreeIndex(), cvflann::KDTreeSingleIndex< Distance >::KDTreeSingleIndex(), cvflann::KMeansIndex< Distance >::KMeansIndex(), cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), cvflann::LshIndex< Distance >::knnSearch(), and cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().
T cvflann::get_param | ( | const IndexParams & | params, |
cv::String | name | ||
) |
int cvflann::hierarchicalClustering | ( | const Matrix< typename Distance::ElementType > & | points, |
Matrix< typename Distance::ResultType > & | centers, | ||
const KMeansIndexParams & | params, | ||
Distance | d = Distance() |
||
) |
Performs a hierarchical clustering of the points passed as argument and then takes a cut in the the clustering tree to return a flat clustering.
[in] | points | Points to be clustered |
centers | The computed cluster centres. Matrix should be preallocated and centers.rows is the number of clusters requested. | |
params | Clustering parameters (The same as for cvflann::KMeansIndex) | |
d | Distance to be used for clustering (eg: cvflann::L2) |
References cvflann::KMeansIndex< Distance >::buildIndex(), cvflann::KMeansIndex< Distance >::getClusterCenters(), and cv::kmeans().
|
inline |
stream | - Stream to load from |
References cvflann::IndexHeader::signature.
Referenced by load_saved_index().
NNIndex<Distance>* cvflann::load_saved_index | ( | const Matrix< typename Distance::ElementType > & | dataset, |
const cv::String & | filename, | ||
Distance | distance | ||
) |
References cvflann::Matrix< T >::cols, cvflann::IndexHeader::cols, cvflann::IndexHeader::data_type, cvflann::IndexHeader::index_type, load_header(), cvflann::NNIndex< Distance >::loadIndex(), cvflann::Matrix< T >::rows, and cvflann::IndexHeader::rows.
void cvflann::load_value | ( | FILE * | stream, |
T & | value, | ||
size_t | count = 1 |
||
) |
Referenced by cvflann::KDTreeSingleIndex< Distance >::findNeighbors(), cvflann::KDTreeIndex< Distance >::getParameters(), cvflann::KMeansIndex< Distance >::getParameters(), cvflann::HierarchicalClusteringIndex< Distance >::getParameters(), cvflann::LshIndex< Distance >::loadIndex(), cvflann::AutotunedIndex< Distance >::loadIndex(), cvflann::KDTreeIndex< Distance >::loadIndex(), cvflann::KDTreeSingleIndex< Distance >::loadIndex(), cvflann::KMeansIndex< Distance >::loadIndex(), and cvflann::HierarchicalClusteringIndex< Distance >::loadIndex().
void cvflann::load_value | ( | FILE * | stream, |
cvflann::Matrix< T > & | value | ||
) |
void cvflann::load_value | ( | FILE * | stream, |
std::vector< T > & | value | ||
) |
|
inline |
Sets the log level used for all flann functions.
level | Verbosity level |
References cvflann::Logger::setLevel().
|
inline |
float cvflann::optimizeSimplexDownhill | ( | T * | points, |
int | n, | ||
F | func, | ||
float * | vals = NULL |
||
) |
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
References addValue(), and cvflann::Logger::info().
|
inline |
Referenced by cvflann::AutotunedIndex< Distance >::buildIndex(), and print_params().
|
inline |
|
inline |
References cv::RNG::next(), cv::theRNG(), and cv::RNG::uniform().
Referenced by rand_double(), rand_int(), and random_sample().
|
inline |
Generates a random double value.
high | Upper limit |
low | Lower limit |
References rand().
Referenced by cvflann::KMeansIndex< Distance >::chooseCentersKMeanspp().
|
inline |
Generates a random integer value.
high | Upper limit |
low | Lower limit |
References rand().
Referenced by cvflann::KMeansIndex< Distance >::chooseCentersGonzales(), cvflann::KMeansIndex< Distance >::chooseCentersKMeanspp(), cvflann::KDTreeIndex< Distance >::getParameters(), and random_sample().
Matrix<T> cvflann::random_sample | ( | Matrix< T > & | srcMatrix, |
long | size, | ||
bool | remove = false |
||
) |
References rand_int().
Referenced by cvflann::AutotunedIndex< Distance >::getType().
void cvflann::save_header | ( | FILE * | stream, |
const NNIndex< Distance > & | index | ||
) |
Saves index header to stream.
stream | - Stream to save to |
index | - The index to save |
References cvflann::IndexHeader::cols, cvflann::IndexHeader::data_type, cvflann::NNIndex< Distance >::getType(), cvflann::IndexHeader::index_type, cvflann::IndexHeader::rows, cvflann::IndexHeader::signature, cvflann::NNIndex< Distance >::size(), cvflann::NNIndex< Distance >::veclen(), and cvflann::IndexHeader::version.
Referenced by cvflann::Index< cv::L1< ElementType > >::save().
void cvflann::save_value | ( | FILE * | stream, |
const T & | value, | ||
size_t | count = 1 |
||
) |
Referenced by cvflann::KDTreeSingleIndex< Distance >::findNeighbors(), cvflann::KDTreeIndex< Distance >::getParameters(), cvflann::KMeansIndex< Distance >::getParameters(), cvflann::HierarchicalClusteringIndex< Distance >::getParameters(), cvflann::AutotunedIndex< Distance >::saveIndex(), cvflann::LshIndex< Distance >::saveIndex(), cvflann::KDTreeSingleIndex< Distance >::saveIndex(), cvflann::KDTreeIndex< Distance >::saveIndex(), cvflann::KMeansIndex< Distance >::saveIndex(), and cvflann::HierarchicalClusteringIndex< Distance >::saveIndex().
void cvflann::save_value | ( | FILE * | stream, |
const cvflann::Matrix< T > & | value | ||
) |
void cvflann::save_value | ( | FILE * | stream, |
const std::vector< T > & | value | ||
) |
float cvflann::search_with_ground_truth | ( | NNIndex< Distance > & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< int > & | matches, | ||
int | nn, | ||
int | checks, | ||
float & | time, | ||
typename Distance::ResultType & | dist, | ||
const Distance & | distance, | ||
int | skipMatches | ||
) |
References countCorrectMatches(), cvflann::NNIndex< Distance >::findNeighbors(), cvflann::Logger::info(), cvflann::KNNResultSet< DistanceType >::init(), cvflann::Matrix< T >::rows, cvflann::StartStopTimer::start(), cvflann::StartStopTimer::stop(), and cvflann::StartStopTimer::value.
Referenced by test_index_checks(), test_index_precision(), and test_index_precisions().
|
inline |
Seeds the random number generator.
seed | Random seed |
References cv::theRNG().
void cvflann::set_distance_type | ( | flann_distance_t | distance_type, |
int | order | ||
) |
float cvflann::test_index_checks | ( | NNIndex< Distance > & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< int > & | matches, | ||
int | checks, | ||
float & | precision, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 |
||
) |
References cvflann::Logger::info(), and search_with_ground_truth().
float cvflann::test_index_precision | ( | NNIndex< Distance > & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< int > & | matches, | ||
float | precision, | ||
int & | checks, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 |
||
) |
References cvflann::Logger::info(), and search_with_ground_truth().
Referenced by cvflann::AutotunedIndex< Distance >::getType().
void cvflann::test_index_precisions | ( | NNIndex< Distance > & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< int > & | matches, | ||
float * | precisions, | ||
int | precisions_length, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 , |
||
float | maxTime = 0 |
||
) |
References cvflann::Logger::info(), search_with_ground_truth(), and cv::sort().
const size_t cvflann::BLOCKSIZE =8192 |
Referenced by cvflann::PooledAllocator::allocateMemory().
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.