OpenCV
3.0.0-dev
Open Source Computer Vision
|
Namespaces | |
anyimpl | |
lsh | |
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) |
template<typename T > | |
T * | allocate (size_t count=1) |
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()) |
template<typename T > | |
void | load_from_file (cvflann::Matrix< T > &dataset, const String &filename, const String &name) |
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) |
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) |
void | print_params (const IndexParams ¶ms, std::ostream &stream) |
void | print_params (const IndexParams ¶ms) |
double | rand_double (double high=1.0, double low=0) |
int | rand_int (int high=RAND_MAX, int low=0) |
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) |
template<typename T > | |
void | save_to_file (const cvflann::Matrix< T > &dataset, const String &filename, const String &name) |
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) |
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 |
typedef std::map<cv::String, any> cvflann::IndexParams |
|
inline |
|
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.
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() |
||
) |
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 | ||
) |
void cvflann::dummyfunc | ( | ) |
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() |
||
) |
flann_distance_t cvflann::flann_distance_type | ( | ) |
T cvflann::get_param | ( | const IndexParams & | params, |
cv::String | name, | ||
const T & | default_value | ||
) |
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) |
void cvflann::load_from_file | ( | cvflann::Matrix< T > & | dataset, |
const String & | filename, | ||
const String & | name | ||
) |
|
inline |
stream | - Stream to load from |
NNIndex<Distance>* cvflann::load_saved_index | ( | const Matrix< typename Distance::ElementType > & | dataset, |
const cv::String & | filename, | ||
Distance | distance | ||
) |
void cvflann::load_value | ( | FILE * | stream, |
T & | value, | ||
size_t | count = 1 |
||
) |
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 |
|
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
|
inline |
|
inline |
|
inline |
Generates a random double value.
high | Upper limit |
low | Lower limit |
|
inline |
Generates a random integer value.
high | Upper limit |
low | Lower limit |
Matrix<T> cvflann::random_sample | ( | Matrix< T > & | srcMatrix, |
long | size, | ||
bool | remove = false |
||
) |
Matrix<T> cvflann::random_sample | ( | const Matrix< T > & | srcMatrix, |
size_t | size | ||
) |
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 |
void cvflann::save_to_file | ( | const cvflann::Matrix< T > & | dataset, |
const String & | filename, | ||
const String & | name | ||
) |
void cvflann::save_value | ( | FILE * | stream, |
const T & | value, | ||
size_t | count = 1 |
||
) |
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 | ||
) |
|
inline |
Seeds the random number generator
seed | Random seed |
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 |
||
) |
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 |
||
) |
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 |
||
) |
const size_t cvflann::BLOCKSIZE =8192 |
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.