Namespaces
Classes
Typedefs
Enumerations
enum
flann_algorithm_t {
FLANN_INDEX_LINEAR = 0,
FLANN_INDEX_KDTREE = 1,
FLANN_INDEX_KMEANS = 2,
FLANN_INDEX_COMPOSITE = 3,
FLANN_INDEX_KDTREE_SINGLE = 4,
FLANN_INDEX_HIERARCHICAL = 5,
FLANN_INDEX_LSH = 6,
FLANN_INDEX_SAVED = 254,
FLANN_INDEX_AUTOTUNED = 255,
LINEAR = 0,
KDTREE = 1,
KMEANS = 2,
COMPOSITE = 3,
KDTREE_SINGLE = 4,
SAVED = 254,
AUTOTUNED = 255
}
enum
flann_distance_t {
FLANN_DIST_EUCLIDEAN = 1,
FLANN_DIST_L2 = 1,
FLANN_DIST_MANHATTAN = 2,
FLANN_DIST_L1 = 2,
FLANN_DIST_MINKOWSKI = 3,
FLANN_DIST_MAX = 4,
FLANN_DIST_HIST_INTERSECT = 5,
FLANN_DIST_HELLINGER = 6,
FLANN_DIST_CHI_SQUARE = 7,
FLANN_DIST_CS = 7,
FLANN_DIST_KULLBACK_LEIBLER = 8,
FLANN_DIST_KL = 8,
FLANN_DIST_HAMMING = 9,
EUCLIDEAN = 1,
MANHATTAN = 2,
MINKOWSKI = 3,
MAX_DIST = 4,
HIST_INTERSECT = 5,
HELLINGER = 6,
CS = 7,
KL = 8,
KULLBACK_LEIBLER = 8
}
Functions
template<typename Distance >
template<typename Distance >
template<typename T >
template<typename T >
template<typename T >
template<>
template<>
template<>
template<typename Distance >
template<typename Distance >
template<typename T >
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())
template<typename Distance >
template<typename Distance >
template<typename T >
template<typename T >
template<typename T >
template<typename T >
template<typename T >
template<typename T >
template<typename T >
template<typename T >
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)
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)
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)
template<typename T >
template<typename T >
template<typename Distance >
std::ostream &
operator<< (std::ostream &out, const
any &any_val)
template<typename T >
template<typename T , typename F >
Variables
Typedef Documentation
§ IndexParams
Enumeration Type Documentation
§ anonymous enum
Enumerator |
---|
FLANN_CHECKS_UNLIMITED |
FLANN_CHECKS_AUTOTUNED |
§ flann_algorithm_t
Enumerator |
---|
FLANN_INDEX_LINEAR |
FLANN_INDEX_KDTREE |
FLANN_INDEX_KMEANS |
FLANN_INDEX_COMPOSITE |
FLANN_INDEX_KDTREE_SINGLE |
FLANN_INDEX_HIERARCHICAL |
FLANN_INDEX_LSH |
FLANN_INDEX_SAVED |
FLANN_INDEX_AUTOTUNED |
LINEAR |
KDTREE |
KMEANS |
COMPOSITE |
KDTREE_SINGLE |
SAVED |
AUTOTUNED |
§ flann_centers_init_t
Enumerator |
---|
FLANN_CENTERS_RANDOM |
FLANN_CENTERS_GONZALES |
FLANN_CENTERS_KMEANSPP |
CENTERS_RANDOM |
CENTERS_GONZALES |
CENTERS_KMEANSPP |
§ flann_datatype_t
Enumerator |
---|
FLANN_INT8 |
FLANN_INT16 |
FLANN_INT32 |
FLANN_INT64 |
FLANN_UINT8 |
FLANN_UINT16 |
FLANN_UINT32 |
FLANN_UINT64 |
FLANN_FLOAT32 |
FLANN_FLOAT64 |
§ flann_distance_t
Enumerator |
---|
FLANN_DIST_EUCLIDEAN |
FLANN_DIST_L2 |
FLANN_DIST_MANHATTAN |
FLANN_DIST_L1 |
FLANN_DIST_MINKOWSKI |
FLANN_DIST_MAX |
FLANN_DIST_HIST_INTERSECT |
FLANN_DIST_HELLINGER |
FLANN_DIST_CHI_SQUARE |
FLANN_DIST_CS |
FLANN_DIST_KULLBACK_LEIBLER |
FLANN_DIST_KL |
FLANN_DIST_HAMMING |
EUCLIDEAN |
MANHATTAN |
MINKOWSKI |
MAX_DIST |
HIST_INTERSECT |
HELLINGER |
CS |
KL |
KULLBACK_LEIBLER |
§ flann_log_level_t
Enumerator |
---|
FLANN_LOG_NONE |
FLANN_LOG_FATAL |
FLANN_LOG_ERROR |
FLANN_LOG_WARN |
FLANN_LOG_INFO |
Function Documentation
§ abs()
template<typename T >
T cvflann::abs
(
T
x )
inline |
§ abs< double>()
§ abs< float>()
§ abs< int>()
§ addValue()
template<typename T >
float
val,
float *
vals,
T *
point,
T *
points,
)
Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.
§ allocate()
template<typename T >
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
§ compute_ground_truth()
template<typename Distance >
void cvflann::compute_ground_truth
(
const
Matrix< typename Distance::ElementType > &
dataset,
const
Matrix< typename Distance::ElementType > &
testset,
Distance
d = Distance()
)
§ computeDistanceRaport()
template<typename Distance >
Distance::ResultType cvflann::computeDistanceRaport
(
const
Matrix< typename Distance::ElementType > &
inputData,
typename Distance::ElementType *
target,
const Distance &
distance
)
§ countCorrectMatches()
int cvflann::countCorrectMatches
(
int *
neighbors,
)
inline |
§ create_index_by_type()
template<typename Distance >
NNIndex< Distance > * cvflann::create_index_by_type
(
const
Matrix< typename Distance::ElementType > &
dataset,
const Distance &
distance
)
§ dummyfunc()
void cvflann::dummyfunc
(
)
§ ensureSimpleDistance()
template<typename Distance >
Distance::ResultType cvflann::ensureSimpleDistance
(
typename Distance::ResultType
dist )
§ ensureSquareDistance()
template<typename Distance >
Distance::ResultType cvflann::ensureSquareDistance
(
typename Distance::ResultType
dist )
§ find_nearest()
template<typename Distance >
void cvflann::find_nearest
(
const
Matrix< typename Distance::ElementType > &
dataset,
typename Distance::ElementType *
query,
Distance
distance = Distance()
)
§ flann_distance_type()
§ get_param() [1/2]
template<typename T >
std::string
name,
const T &
default_value
)
§ get_param() [2/2]
template<typename T >
std::string
name
)
§ hierarchicalClustering()
template<typename Distance >
int cvflann::hierarchicalClustering
(
const
Matrix< typename Distance::ElementType > &
points,
Matrix< typename Distance::ResultType > &
centers,
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.
- Parameters
-
[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)
- Returns
- number of clusters computed (can be different than clusters.rows and is the highest number of the form (branching-1)*K+1 smaller than clusters.rows).
§ load_from_file()
template<typename T >
const std::string &
filename,
const std::string &
name
)
§ load_header()
- Parameters
-
stream - Stream to load from
- Returns
- Index header
§ load_saved_index()
template<typename Distance >
NNIndex<Distance>* cvflann::load_saved_index
(
const
Matrix< typename Distance::ElementType > &
dataset,
const std::string &
filename,
Distance
distance
)
§ load_value() [1/3]
template<typename T >
void cvflann::load_value
(
FILE *
stream,
T &
value,
size_t
count = 1
)
§ load_value() [2/3]
template<typename T >
void cvflann::load_value
(
FILE *
stream,
)
§ load_value() [3/3]
template<typename T >
void cvflann::load_value
(
FILE *
stream,
std::vector< T > &
value
)
§ log_verbosity()
void cvflann::log_verbosity
(
int
level )
inline |
Sets the log level used for all flann functions
- Parameters
-
level Verbosity level
§ operator<<()
std::ostream& cvflann::operator<<
(
std::ostream &
out,
)
inline |
§ optimizeSimplexDownhill()
template<typename T , typename F >
float cvflann::optimizeSimplexDownhill
(
T *
points,
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
§ print_params() [1/2]
std::ostream &
stream
)
inline |
§ print_params() [2/2]
§ rand_double()
double cvflann::rand_double
(
double
high = 1.0
,
double
low = 0
)
inline |
Generates a random double value.
- Parameters
-
high Upper limit
low Lower limit
- Returns
- Random double value
§ rand_int()
int cvflann::rand_int
(
int
high =
RAND_MAX
,
)
inline |
Generates a random integer value.
- Parameters
-
high Upper limit
low Lower limit
- Returns
- Random integer value
§ random_sample() [1/2]
template<typename T >
long
size,
bool
remove = false
)
§ random_sample() [2/2]
template<typename T >
Matrix<T> cvflann::random_sample
(
const
Matrix< T > &
srcMatrix,
size_t
size
)
§ save_header()
template<typename Distance >
void cvflann::save_header
(
FILE *
stream,
)
Saves index header to stream
- Parameters
-
stream - Stream to save to
index - The index to save
§ save_to_file()
template<typename T >
const std::string &
filename,
const std::string &
name
)
§ save_value() [1/3]
template<typename T >
void cvflann::save_value
(
FILE *
stream,
const T &
value,
size_t
count = 1
)
§ save_value() [2/3]
template<typename T >
void cvflann::save_value
(
FILE *
stream,
)
§ save_value() [3/3]
template<typename T >
void cvflann::save_value
(
FILE *
stream,
const std::vector< T > &
value
)
§ search_with_ground_truth()
template<typename Distance >
float cvflann::search_with_ground_truth
(
NNIndex< Distance > &
index,
const
Matrix< typename Distance::ElementType > &
inputData,
const
Matrix< typename Distance::ElementType > &
testData,
float &
time,
typename Distance::ResultType &
dist,
const Distance &
distance,
)
§ seed_random()
void cvflann::seed_random
(
unsigned
int
seed )
inline |
Seeds the random number generator
- Parameters
-
seed Random seed
§ set_distance_type()
§ test_index_checks()
template<typename Distance >
float cvflann::test_index_checks
(
NNIndex< Distance > &
index,
const
Matrix< typename Distance::ElementType > &
inputData,
const
Matrix< typename Distance::ElementType > &
testData,
float &
precision,
const Distance &
distance,
)
§ test_index_precision()
template<typename Distance >
float cvflann::test_index_precision
(
NNIndex< Distance > &
index,
const
Matrix< typename Distance::ElementType > &
inputData,
const
Matrix< typename Distance::ElementType > &
testData,
float
precision,
const Distance &
distance,
)
§ test_index_precisions()
template<typename Distance >
void cvflann::test_index_precisions
(
NNIndex< Distance > &
index,
const
Matrix< typename Distance::ElementType > &
inputData,
const
Matrix< typename Distance::ElementType > &
testData,
float *
precisions,
const Distance &
distance,
float
maxTime = 0
)
Variable Documentation
§ BLOCKSIZE
const size_t cvflann::BLOCKSIZE =8192
§ WORDSIZE
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.
- cvflann
- Generated on Thu Dec 21 2017 00:03:49 for OpenCV by
doxygen 1.8.12