8#ifndef META_OCEAN_TEST_TESTTACKING_TEST_VOCABULARY_TREE_H
9#define META_OCEAN_TEST_TESTTACKING_TEST_VOCABULARY_TREE_H
71 template <DescriptorType tDescriptorType>
111 template <DescriptorType tDescriptorType>
121 template <DescriptorType tDescriptorType>
131 template <DescriptorType tDescriptorType>
141 template <DescriptorType tDescriptorType>
162 static constexpr const char*
name_ =
"Binary";
228 static constexpr const char*
name_ =
"Float";
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
static std::vector< DistanceType > descriptorEpsilons(const unsigned int numberEpsilons)
Returns a bunch of descriptor epsilons which can be used for testing.
float DistanceType
Definition of the data type for the distance between two descriptors.
Definition TestVocabularyTree.h:243
std::vector< Descriptor > Descriptors
Definition of a vector holding descriptors.
Definition TestVocabularyTree.h:238
FloatDescriptor Descriptor
Definition of a descriptor data type.
Definition TestVocabularyTree.h:233
static FloatDescriptor modifyDescriptor(const FloatDescriptor &descriptor, RandomGenerator &randomGenerator)
Applies a minor random modification to a given descriptor.
static constexpr const char * name_
The readable name of the descriptor type.
Definition TestVocabularyTree.h:228
static float determineDistance(const FloatDescriptor &descriptorA, const FloatDescriptor &descriptorB)
Determines the square distance between two float descriptors.
Tracking::VocabularyTree< Descriptor, DistanceType, determineDistance > VocabularyTree
Definition of the vocabulary tree data type.
Definition TestVocabularyTree.h:278
static void randomizeDescriptor(FloatDescriptor &descriptor, RandomGenerator &randomGenerator)
Randomizes a descriptor.
static constexpr const VocabularyTree::ClustersMeanFunction clusterMeanFunction_
The function pointer to the cluster mean function.
Definition TestVocabularyTree.h:283
static constexpr const char * name_
The readable name of the descriptor type.
Definition TestVocabularyTree.h:162
unsigned int DistanceType
Definition of the data type for the distance between two descriptors.
Definition TestVocabularyTree.h:177
static BinaryDescriptor modifyDescriptor(const BinaryDescriptor &descriptor, RandomGenerator &randomGenerator)
Applies a minor random modification to a given descriptor.
static DistanceType determineDistance(const BinaryDescriptor &descriptorA, const BinaryDescriptor &descriptorB)
Determines the (hamming) distance between two binary descriptors.
static std::vector< DistanceType > descriptorEpsilons(const unsigned int numberEpsilons)
Returns a bunch of descriptor epsilons which can be used for testing.
static constexpr const VocabularyTree::ClustersMeanFunction clusterMeanFunction_
The function pointer to the cluster mean function.
Definition TestVocabularyTree.h:217
std::vector< Descriptor > Descriptors
Definition of a vector holding descriptors.
Definition TestVocabularyTree.h:172
Tracking::VocabularyTree< Descriptor, DistanceType, determineDistance > VocabularyTree
Definition of the vocabulary tree data type.
Definition TestVocabularyTree.h:212
BinaryDescriptor Descriptor
Definition of a descriptor data type.
Definition TestVocabularyTree.h:167
static void randomizeDescriptor(BinaryDescriptor &descriptor, RandomGenerator &randomGenerator)
Randomizes a descriptor.
Helper class to determine data types for individual descriptor types.
Definition TestVocabularyTree.h:73
This class implements a test for the VocabularyTree class.
Definition TestVocabularyTree.h:35
static bool testDetermineClustersMeanForFloatDescriptor(const double testDuration, Worker &worker)
Tests the function determining the means for clusters of float descriptors.
static bool testMatchingDescriptors(const double testDuration, Worker &worker)
Tests descriptor matching.
static bool testConstructor(const double testDuration, Worker &worker)
Tests the constructor.
std::array< float, floatDescriptorElements_ > FloatDescriptor
Definition of a float descriptor.
Definition TestVocabularyTree.h:65
static bool testMatchingDescriptorsWithForest(const double testDuration, Worker &worker)
Tests descriptor matching with forest.
static Indices32 separateBinaryDescriptor(const BinaryDescriptor &descriptor)
Separates the individual bits of binary descriptor into individual integer values.
std::array< uint8_t, binaryDescriptorElements_ > BinaryDescriptor
Definition of a binary descriptor.
Definition TestVocabularyTree.h:60
static bool test(const double testDuration, Worker &worker, const TestSelector &selector)
Invokes all existing tests for VocabularyTree.
static bool testDetermineClustersMeanForBinaryDescriptor(const double testDuration, Worker &worker)
Tests the function determining the means for clusters of binary descriptors.
static constexpr unsigned int binaryDescriptorElements_
The number of elements/bytes of a binary descriptor.
Definition TestVocabularyTree.h:52
DescriptorType
Definition of individual descriptor types.
Definition TestVocabularyTree.h:42
@ DT_FLOAT
Descriptor based on floats.
Definition TestVocabularyTree.h:46
@ DT_BINARY
Descriptor based on binary data.
Definition TestVocabularyTree.h:44
static constexpr unsigned int floatDescriptorElements_
The number of elements of a float descriptor.
Definition TestVocabularyTree.h:55
static bool testMatchingViaLeaves(const double testDuration, Worker &worker)
Tests manual matching accessing the leaves.
This class implements a Vocabulary Tree for feature descriptors.
Definition VocabularyTree.h:223
TDescriptors(*)(const unsigned int numberClusters, const Descriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker) ClustersMeanFunction
Definition VocabularyTree.h:285
static TDescriptors determineClustersMeanForBinaryDescriptor(const unsigned int numberClusters, const Descriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker)
static TDescriptors determineClustersMeanForFloatDescriptor(const unsigned int numberClusters, const Descriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker)
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition Base.h:96
Namespace of the Tracking Test library.
Definition TestDatabase.h:26
Namespace of the Test library.
Definition LineDetectorHough.h:28
The namespace covering the entire Ocean framework.
Definition Accessor.h:15