Ocean
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction > Class Template Reference

This class implements a Vocabulary Tree for feature descriptors. More...

Inheritance diagram for Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >:

Data Structures

class  ReusableData
 Definition of a class which holds reusable data for internal use. More...
 

Public Types

typedef TDescriptor Descriptor
 The descriptor type of this tree. More...
 
typedef TDistance Distance
 The distance data type of this tree. More...
 
typedef NextLargerTyper< TDistance >::TypePerformance TSumDistances
 The data type of the sum of distances, uint64_t for uint32_t, and float for float. More...
 
typedef std::vector< TDescriptor > TDescriptors
 Definition of a vector holding descriptors. More...
 
typedef std::vector< TDistance > TDistances
 Definition of a vector holding distances. More...
 
typedef VocabularyTree< TDescriptor, TDistance, tDistanceFunction > Node
 Definition of a tree node which is just an alias for the tree (the root node). More...
 
typedef std::vector< Node * > Nodes
 Definition of a vector holding tree nodes. More...
 
typedef std::vector< const Node * > ConstNodes
 Definition of a vector holding constant tree nodes. More...
 
using Match = Match< TDistance >
 Definition of a Match object using the distance data type of this tree. More...
 
using Matches = Matches< TDistance >
 Definition of a vector holding Match objects. More...
 
using ClustersMeanFunction = TDescriptors(*)(const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker)
 Definition of a function pointer allowing to determine the mean descriptors for individual clusters. More...
 
template<typename TMultiDescriptor >
using MultiDescriptorFunction = const TDescriptor *(*)(const TMultiDescriptor &, const size_t)
 Definition of a function pointer to a function allowing to return individual descriptors from a multi-descriptor. More...
 
template<typename TMultiDescriptorGroup , typename TMultiDescriptor >
using MultiDescriptorGroupFunction = const TMultiDescriptor *(*)(const TMultiDescriptorGroup &, const size_t)
 Definition of a function pointer to a function allowing to return individual multi-descriptors from a group of multi-descriptors. More...
 
- Public Types inherited from Ocean::Tracking::VocabularyStructure
enum  InitializationStrategy : uint32_t { IS_INVALID = 0u , IS_PURE_RANDOM , IS_LARGEST_DISTANCE }
 Definition of individual strategies to initialize the clustering of each tree node. More...
 
enum  MatchingMode : uint32_t {
  MM_INVALID = 0u , MM_FIRST_BEST_LEAF , MM_ALL_BEST_LEAFS , MM_ALL_GOOD_LEAFS_1 ,
  MM_ALL_GOOD_LEAFS_2
}
 Definition of individual matching modes for descriptors. More...
 
template<typename TDistance >
using Matches = std::vector< Match< TDistance > >
 Definition of a vector holding matches. More...
 

Public Member Functions

 VocabularyTree ()=default
 Creates an empty vocabulary tree. More...
 
 VocabularyTree (VocabularyTree &&vocabularyTree)
 Move constructor. More...
 
 VocabularyTree (const TDescriptor *treeDescriptors, const size_t numberTreeDescriptors, const ClustersMeanFunction &clustersMeanFunction, const Parameters &parameters=Parameters(), Worker *worker=nullptr, RandomGenerator *randomGenerator=nullptr)
 Creates a new tree for a known descriptors. More...
 
 ~VocabularyTree ()
 Destructs the vocabulary tree. More...
 
const Indices32determineBestLeaf (const TDescriptor &descriptor) const
 Determines the leaf best matching with a given descriptor. More...
 
void determineBestLeafs (const TDescriptor &descriptor, std::vector< const Indices32 * > &leafs, const TDistance distanceEpsilon=TDistance(0)) const
 Determines the leafs best matching with a given descriptor. More...
 
template<MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
Index32 matchDescriptor (const TDescriptor *candidateDescriptors, const TDescriptor &queryDescriptor, TDistance *distance=nullptr, const ReusableData &reusableData=ReusableData()) const
 Matches a query descriptor with all candidate descriptors in this tree. More...
 
template<MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
Index32 matchMultiDescriptor (const TDescriptor *candidateDescriptors, const TDescriptor *queryMultiDescriptor, const size_t numberQuerySingleDescriptors, TDistance *distance=nullptr, const ReusableData &reusableData=ReusableData()) const
 Matches a query multi-descriptor with all candidate descriptors in this tree. More...
 
template<typename TMultiDescriptor , MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
Index32 matchMultiDescriptor (const TDescriptor *candidateDescriptors, const TMultiDescriptor &queryMultiDescriptor, TDistance *distance=nullptr, const ReusableData &reusableData=ReusableData()) const
 Matches a query multi-descriptor with all candidate descriptors in this tree. More...
 
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , MultiDescriptorGroupFunction< TMultiDescriptorGroup, TMultiDescriptor > tMultiDescriptorGroupFunction, MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
Index32 matchMultiDescriptorGroup (const TDescriptor *candidateDescriptors, const TMultiDescriptorGroup &queryMultiDescriptorGroup, TDistance *distance=nullptr, const ReusableData &reusableData=ReusableData()) const
 Matches a query group of multi-descriptors with all candidate descriptors in this tree. More...
 
template<MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
void matchDescriptors (const TDescriptor *candidateDescriptors, const TDescriptor *queryDescriptors, const size_t numberQueryDescriptors, const TDistance maximalDistance, Matches &matches, Worker *worker=nullptr) const
 Matches several query descriptors with all candidate descriptors in this tree. More...
 
template<typename TMultiDescriptor , MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
void matchMultiDescriptors (const TDescriptor *candidateDescriptors, const TMultiDescriptor *queryMultiDescriptors, const size_t numberQueryMultiDescriptors, const TDistance maximalDistance, Matches &matches, Worker *worker=nullptr) const
 Matches several query multi-descriptors with all candidate descriptors in this tree. More...
 
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , MultiDescriptorGroupFunction< TMultiDescriptorGroup, TMultiDescriptor > tMultiDescriptorGroupFunction, MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode = MM_FIRST_BEST_LEAF>
void matchMultiDescriptorGroups (const TDescriptor *candidateDescriptors, const TMultiDescriptorGroup *queryMultiDescriptorGroups, const size_t numberQueryMultiDescriptorGroups, const TDistance maximalDistance, Matches &matches, Worker *worker=nullptr) const
 Matches several query groups of multi-descriptors with all candidate descriptors in this tree. More...
 
const TDescriptor & nodeDescriptor () const
 Returns the descriptor representing this tree/node. More...
 
const Indices32descriptorIndices () const
 Returns all indices of descriptors which belong to this tree/node. More...
 
const NodeschildNodes () const
 Returns all child nodes of this node/tree. More...
 
VocabularyTreeoperator= (VocabularyTree &&vocabularyTree)
 Move operator. More...
 
VocabularyTreeoperator= (const VocabularyTree &vocabularyTree)=delete
 Disabled assign operator. More...
 
- Public Member Functions inherited from Ocean::Tracking::VocabularyStructure
virtual ~VocabularyStructure ()=default
 Destructs this object. More...
 

Static Public Member Functions

template<unsigned int tSize>
static TDescriptors determineClustersMeanForBinaryDescriptor (const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker)
 Determines a binary mean descriptor for each cluster. More...
 
template<unsigned int tSize>
static TDescriptors determineClustersMeanForFloatDescriptor (const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker)
 Determines a float mean descriptor for each cluster. More...
 
- Static Public Member Functions inherited from Ocean::Tracking::VocabularyStructure
static constexpr Index32 invalidMatchIndex ()
 Returns an invalid matching index. More...
 

Static Public Attributes

static constexpr TDistance(* distanceFunction )(const TDescriptor &, const TDescriptor &) = tDistanceFunction
 The pointer to the function determining the distance between two descriptors of this tree. More...
 

Protected Member Functions

 VocabularyTree (const VocabularyTree &vocabularyTree)=delete
 Disabled copy constructor. More...
 
 VocabularyTree (const unsigned int level, const TDescriptor &nodeDescriptor, const Parameters &parameters, const TDescriptor *treeDescriptors, Index32 *reusableDescriptorIndicesInput, Index32 *reusableDescriptorIndicesOutput, const size_t numberDescriptorsIndices, RandomGenerator &randomGenerator, Index32 *reusableClusterIndicesForDescriptors, const ClustersMeanFunction &clustersMeanFunction, Worker *worker)
 Creates a new intermediate tree node. More...
 
 VocabularyTree (const unsigned int level, const TDescriptor &nodeDescriptor, Index32 *descriptorIndices, size_t numberDescriptorsIndices)
 Creates a new leaf node. More...
 
void createChildNodes (const unsigned int childNodeLevel, const Parameters &parameters, const TDescriptor *treeDescriptors, const TDescriptor *clusterCenters, const unsigned int *clusterSizes, const size_t numberClusters, Index32 *reusableDescriptorIndicesInput, Index32 *reusableDescriptorIndicesOutput, const size_t numberDescriptorsIndices, RandomGenerator &randomGenerator, Index32 *reusableClusterIndicesForDescriptors, const ClustersMeanFunction &clustersMeanFunction, Worker *worker)
 Creates the new child nodes. More...
 
TDescriptors clusterDescriptors (const Parameters &parameters, const TDescriptor *treeDescriptors, Index32 *reusableDescriptorIndicesInput, Index32 *reusableDescriptorIndicesOutput, size_t numberDescriptorsIndices, RandomGenerator &randomGenerator, Index32 *clusterIndicesForDescriptors, const ClustersMeanFunction &clustersMeanFunction, Indices32 *clusterSizes=nullptr, Worker *worker=nullptr)
 Distributes several descriptors into individual clusters. More...
 
TDescriptors initialClusters (const Parameters &parameters, const TDescriptor *treeDescriptors, Index32 *reusableDescriptorIndicesInput, Index32 *reusableDescriptorIndicesOutput, size_t numberDescriptorsIndices, RandomGenerator &randomGenerator)
 Determines the initial clusters based on specified initialization strategy. More...
 
TDescriptors initialClustersLargestDistance (const Parameters &parameters, const TDescriptor *treeDescriptors, Index32 *descriptorIndices, Index32 *reusableIndices, const size_t numberDescriptorsIndices, RandomGenerator &randomGenerator) const
 Determines the initial clusters based on the largest distance between each other. More...
 
TDescriptors initialClustersPureRandom (const Parameters &parameters, const TDescriptor *treeDescriptors, Index32 *descriptorIndices, const size_t numberDescriptorsIndices, RandomGenerator &randomGenerator) const
 Determines the initial cluster based on a pure random choice. More...
 
void createChildNodesSubset (const unsigned int childNodeLevel, const Parameters *parameters, const TDescriptor *treeDescriptors, const TDescriptor *clusterCenters, const unsigned int *clusterSizes, const size_t numberClusters, Index32 *reusableDescriptorIndicesInput, Index32 *reusableDescriptorIndicesOutput, const size_t numberDescriptorsIndices, RandomGenerator *randomGenerator, Index32 *reusableClusterIndicesForDescriptors, const ClustersMeanFunction *clustersMeanFunction, const unsigned int subsetFirstCluster, const unsigned int subsetNumberClusters)
 Creates a subset of the new child nodes. More...
 
template<MatchingMode tMatchingMode>
void matchDescriptorsSubset (const TDescriptor *candidateDescriptors, const TDescriptor *queryDescriptors, const TDistance maximalDistance, Matches *matches, Lock *lock, const unsigned int firstQueryDescriptor, const unsigned int numberQueryDescriptors) const
 Matches a subset of several query descriptors with all tree candidate descriptors. More...
 
template<typename TMultiDescriptor , MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode>
void matchMultiDescriptorsSubset (const TDescriptor *candidateDescriptors, const TMultiDescriptor *queryMultiDescriptors, const TDistance maximalDistance, Matches *matches, Lock *lock, const unsigned int firstQueryMultiDescriptor, const unsigned int numberQueryMultiDescriptors) const
 Matches a subset of several query multi-descriptors with all tree candidate descriptors. More...
 
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , MultiDescriptorGroupFunction< TMultiDescriptorGroup, TMultiDescriptor > tMultiDescriptorGroupFunction, MultiDescriptorFunction< TMultiDescriptor > tMultiDescriptorFunction, MatchingMode tMatchingMode>
void matchMultiDescriptorGroupsSubset (const TDescriptor *candidateDescriptors, const TMultiDescriptorGroup *queryMultiDescriptorGroups, const TDistance maximalDistance, Matches *matches, Lock *lock, const unsigned int firstQueryMultiDescriptorGroup, const unsigned int numberQueryMultiDescriptorGroups) const
 Matches a subset of several query groups of multi-descriptors with all candidate descriptors in this tree. More...
 
- Protected Member Functions inherited from Ocean::Tracking::VocabularyStructure
 VocabularyStructure ()=default
 Default constructor. More...
 

Static Protected Member Functions

static Indices32 assignDescriptorsToClusters (const TDescriptor *clusterCenters, const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, TSumDistances *sumDistances=nullptr, Worker *worker=nullptr)
 Assigns descriptors to clusters. More...
 
static void assignDescriptorsToClustersSubset (const TDescriptor *clusterCenters, const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, Index32 *clusterIndicesForDescriptors, Index32 *clusterSizes, TSumDistances *sumDistances, Lock *lock, const unsigned int firstDescriptorIndex, const unsigned int numberDescriptorIndices)
 Assigns a subset of descriptors to clusters. More...
 
- Static Protected Member Functions inherited from Ocean::Tracking::VocabularyStructure
static std::vector< uint8_t > generateBitSeparationLookup8 ()
 Returns the lookup table which separates the bits of a byte into 8 individual bytes. More...
 

Protected Attributes

unsigned int level_ = 0u
 The node's level. More...
 
TDescriptor nodeDescriptor_
 The node's descriptor. More...
 
Indices32 descriptorIndices_
 The indices of the descriptors which are part of this node. More...
 
Nodes childNodes_
 The child-nodes of this node. More...
 

Detailed Description

template<typename TDescriptor, typename TDistance, TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
class Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >

This class implements a Vocabulary Tree for feature descriptors.

Trees will not own the memory of the provided descriptors.
Tree descriptors have to be provided as one memory array and trees store indices to these descriptors only.
The tree descriptors need to exist as long as the corresponding tree exists.

Template Parameters
TDescriptorThe data type of the descriptors for which the tree will be created
TDistanceThe data type of the distance measure between two descriptors, e.g., 'unsigned int', 'float'
tDistanceFunctionThe pointers to the function able to calculate the distance between two descriptors
See also
VocabularyForest

Member Typedef Documentation

◆ ClustersMeanFunction

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::ClustersMeanFunction = TDescriptors(*)(const unsigned int numberClusters, const TDescriptor* treeDescriptors, const Index32* descriptorIndices, const Index32* clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker* worker)

Definition of a function pointer allowing to determine the mean descriptors for individual clusters.

See also
determineClustersMeanForBinaryDescriptor(), determineClustersMeanForFloatDescriptor().

◆ ConstNodes

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<const Node*> Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::ConstNodes

Definition of a vector holding constant tree nodes.

◆ Descriptor

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef TDescriptor Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Descriptor

The descriptor type of this tree.

◆ Distance

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef TDistance Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Distance

The distance data type of this tree.

◆ Match

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Match = Match<TDistance>

Definition of a Match object using the distance data type of this tree.

◆ Matches

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Matches = Matches<TDistance>

Definition of a vector holding Match objects.

◆ MultiDescriptorFunction

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptor >
using Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::MultiDescriptorFunction = const TDescriptor*(*)(const TMultiDescriptor&, const size_t)

Definition of a function pointer to a function allowing to return individual descriptors from a multi-descriptor.

A feature point can be described with a multi-descriptor if the feature point has been seen from individual distances (to be scale invariant to some extent). First function parameter is the multi-descriptor, second parameter is the index of the actual descriptor to return, returns nullptr if the index is out of range

◆ MultiDescriptorGroupFunction

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptorGroup , typename TMultiDescriptor >
using Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::MultiDescriptorGroupFunction = const TMultiDescriptor*(*)(const TMultiDescriptorGroup&, const size_t)

Definition of a function pointer to a function allowing to return individual multi-descriptors from a group of multi-descriptors.

A feature point can be described with a group of multi-descriptors if the feature point has been seen from individual locations or at individual moments in time (e.g., day vs. night). First function parameter is the multi-descriptor group, second parameter is the index of the actual multi-descriptor to return, returns nullptr if the index is out of range

◆ Node

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef VocabularyTree<TDescriptor, TDistance, tDistanceFunction> Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Node

Definition of a tree node which is just an alias for the tree (the root node).

◆ Nodes

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<Node*> Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Nodes

Definition of a vector holding tree nodes.

◆ TDescriptors

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<TDescriptor> Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors

Definition of a vector holding descriptors.

◆ TDistances

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<TDistance> Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDistances

Definition of a vector holding distances.

◆ TSumDistances

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef NextLargerTyper<TDistance>::TypePerformance Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TSumDistances

The data type of the sum of distances, uint64_t for uint32_t, and float for float.

Constructor & Destructor Documentation

◆ VocabularyTree() [1/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( )
default

Creates an empty vocabulary tree.

◆ VocabularyTree() [2/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( VocabularyTree< TDescriptor, TDistance, tDistanceFunction > &&  vocabularyTree)

Move constructor.

Parameters
vocabularyTreeThe vocabulary tree to be moved

◆ VocabularyTree() [3/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( const TDescriptor *  treeDescriptors,
const size_t  numberTreeDescriptors,
const ClustersMeanFunction clustersMeanFunction,
const Parameters parameters = Parameters(),
Worker worker = nullptr,
RandomGenerator randomGenerator = nullptr 
)

Creates a new tree for a known descriptors.

The given descriptors must not change afterwards, the descriptors must exist as long as the tree exists.

Parameters
treeDescriptorsThe descriptors for which the new tree will be created, must be valid
numberTreeDescriptorsThe number of tree descriptors, with range [1, infinity)
clustersMeanFunctionThe function allowing to determine the mean descriptors for individual clusters, must be valid
parametersThe parameters used to construct the tree, must be valid
workerOptional worker object to distribute the computation
randomGeneratorOptional explicit random generator object

◆ ~VocabularyTree()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::~VocabularyTree

Destructs the vocabulary tree.

◆ VocabularyTree() [4/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( const VocabularyTree< TDescriptor, TDistance, tDistanceFunction > &  vocabularyTree)
protecteddelete

Disabled copy constructor.

Parameters
vocabularyTreeThe vocabulary tree to be copied

◆ VocabularyTree() [5/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( const unsigned int  level,
const TDescriptor &  nodeDescriptor,
const Parameters parameters,
const TDescriptor *  treeDescriptors,
Index32 reusableDescriptorIndicesInput,
Index32 reusableDescriptorIndicesOutput,
const size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator,
Index32 reusableClusterIndicesForDescriptors,
const ClustersMeanFunction clustersMeanFunction,
Worker worker 
)
protected

Creates a new intermediate tree node.

Parameters
levelThe current node level, with range [0, infinity)
nodeDescriptorThe descriptor of the new node
parametersThe parameters used to construct the tree node, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of this new tree node, must be valid
reusableDescriptorIndicesInputThe indices of the descriptors for which the new node will be created, must be valid
reusableDescriptorIndicesOutputMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of given indices in 'reusableDescriptorIndicesInput', with range [1, infinity)
randomGeneratorThe random generator to be used
reusableClusterIndicesForDescriptorsMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be reused internally, must be valid
clustersMeanFunctionThe function allowing to determine the mean descriptors for individual clusters, must be valid
workerOptional worker object to distribute the computation

◆ VocabularyTree() [6/6]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::VocabularyTree ( const unsigned int  level,
const TDescriptor &  nodeDescriptor,
Index32 descriptorIndices,
size_t  numberDescriptorsIndices 
)
protected

Creates a new leaf node.

Parameters
levelThe level of the leaf node, with range [0, infinity)
nodeDescriptorThe descriptor of the leaf node
descriptorIndicesThe indices of the descriptors which represent the leaf node, must be valid
numberDescriptorsIndicesThe number of given descriptor indices, with range [1, infinity)

Member Function Documentation

◆ assignDescriptorsToClusters()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Indices32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::assignDescriptorsToClusters ( const TDescriptor *  clusterCenters,
const unsigned int  numberClusters,
const TDescriptor *  treeDescriptors,
const Index32 descriptorIndices,
Index32 clusterIndicesForDescriptors,
const size_t  numberDescriptorIndices,
TSumDistances sumDistances = nullptr,
Worker worker = nullptr 
)
staticprotected

Assigns descriptors to clusters.

Parameters
clusterCentersThe centers of the clusters to which the descriptors will be assigned, must be valid
numberClustersThe number of clusters, with range [1, infinity)
treeDescriptorsThe descriptors of the entire tree from which some will belong to the new clusters, must be valid
descriptorIndicesThe indices of the descriptors which need to be assigned, must be valid
clusterIndicesForDescriptorsThe resulting cluster indices to which the descriptors have been assigned, must be valid
numberDescriptorIndicesThe number of given indices of descriptors which will be assigned to the clusters, with range [1, infinity)
sumDistancesOptional resulting sum of distances between all assigned descriptors and their corresponding cluster centers, nullptr if not of interest
workerOptional worker to distribute the computation

◆ assignDescriptorsToClustersSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::assignDescriptorsToClustersSubset ( const TDescriptor *  clusterCenters,
const unsigned int  numberClusters,
const TDescriptor *  treeDescriptors,
const Index32 descriptorIndices,
Index32 clusterIndicesForDescriptors,
Index32 clusterSizes,
TSumDistances sumDistances,
Lock lock,
const unsigned int  firstDescriptorIndex,
const unsigned int  numberDescriptorIndices 
)
staticprotected

Assigns a subset of descriptors to clusters.

Parameters
clusterCentersThe centers of the clusters to which the descriptors will be assigned, must be valid
numberClustersThe number of clusters, with range [1, infinity)
treeDescriptorsThe descriptors of the entire tree from which some will belong to the new clusters, must be valid
descriptorIndicesThe indices of the descriptors which need to be assigned, must be valid
clusterIndicesForDescriptorsThe resulting cluster indices to which the descriptors have been assigned, must be valid
clusterSizesThe sizes of the individual clusters, one for each cluster, must be valid
sumDistancesOptional resulting sum of distances between all assigned descriptors and their corresponding cluster centers, nullptr if not of interest
lockOptional lock when executed in multiple threads in parallel, nullptr otherwise
firstDescriptorIndexThe first descriptor index to be handled, with range [0, infinity)
numberDescriptorIndicesThe number of descriptor indices to be handled, with range [1, infinity)

◆ childNodes()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
const VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::Nodes & Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::childNodes
inline

Returns all child nodes of this node/tree.

Returns
The node's child nodes, empty for leaf nodes

◆ clusterDescriptors()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::clusterDescriptors ( const Parameters parameters,
const TDescriptor *  treeDescriptors,
Index32 reusableDescriptorIndicesInput,
Index32 reusableDescriptorIndicesOutput,
size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator,
Index32 clusterIndicesForDescriptors,
const ClustersMeanFunction clustersMeanFunction,
Indices32 clusterSizes = nullptr,
Worker worker = nullptr 
)
protected

Distributes several descriptors into individual clusters.

Parameters
parametersThe parameters used to construct the tree, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
reusableDescriptorIndicesInputThe indices of the descriptors for which the new clusters will be created, must be valid
reusableDescriptorIndicesOutputMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of provided indices of the tree descriptors, with range [1, infinity)
randomGeneratorThe random generator to be used
clusterIndicesForDescriptorsThe resulting cluster indices to which the descriptors have been assigned, must be valid
clustersMeanFunctionThe function allowing to determine the mean descriptors for individual clusters, must be valid
clusterSizesOptional resulting sizes of the individual resulting clusters
workerOptional worker object to distribute the computation
Returns
The descriptors of the centers of the resulting clusters

◆ createChildNodes()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::createChildNodes ( const unsigned int  childNodeLevel,
const Parameters parameters,
const TDescriptor *  treeDescriptors,
const TDescriptor *  clusterCenters,
const unsigned int *  clusterSizes,
const size_t  numberClusters,
Index32 reusableDescriptorIndicesInput,
Index32 reusableDescriptorIndicesOutput,
const size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator,
Index32 reusableClusterIndicesForDescriptors,
const ClustersMeanFunction clustersMeanFunction,
Worker worker 
)
protected

Creates the new child nodes.

Parameters
childNodeLevelThe level of the child nodes, with range [1, infinity)
parametersThe parameters used to construct the tree node, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of this new tree node, must be valid
clusterCentersThe descriptors of the individual child nodes (the centers of the clusters, one for each child node, must be valid
clusterSizesThe sizes of the individual clusters, one for each cluster, must be valid
numberClustersThe number of clusters and thus the number of child nodes, with range [1, infinity)
reusableDescriptorIndicesInputThe indices of the descriptors for which the new node will be created, must be valid
reusableDescriptorIndicesOutputMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of given indices in 'reusableDescriptorIndicesInput', with range [1, infinity)
randomGeneratorThe random generator to be used
reusableClusterIndicesForDescriptorsMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be reused internally, must be valid
clustersMeanFunctionThe function allowing to determine the mean descriptors for individual clusters, must be valid
workerOptional worker object to distribute the computation

◆ createChildNodesSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::createChildNodesSubset ( const unsigned int  childNodeLevel,
const Parameters parameters,
const TDescriptor *  treeDescriptors,
const TDescriptor *  clusterCenters,
const unsigned int *  clusterSizes,
const size_t  numberClusters,
Index32 reusableDescriptorIndicesInput,
Index32 reusableDescriptorIndicesOutput,
const size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator,
Index32 reusableClusterIndicesForDescriptors,
const ClustersMeanFunction clustersMeanFunction,
const unsigned int  subsetFirstCluster,
const unsigned int  subsetNumberClusters 
)
protected

Creates a subset of the new child nodes.

Parameters
childNodeLevelThe level of the child nodes, with range [1, infinity)
parametersThe parameters used to construct the tree node, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of this new tree node, must be valid
clusterCentersThe descriptors of the individual child nodes (the centers of the clusters, one for each child node, must be valid
clusterSizesThe sizes of the individual clusters, one for each cluster, must be valid
numberClustersThe number of clusters and thus the number of child nodes, with range [1, infinity)
reusableDescriptorIndicesInputThe indices of the descriptors for which the new node will be created, must be valid
reusableDescriptorIndicesOutputMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of given indices in 'reusableDescriptorIndicesInput', with range [1, infinity)
randomGeneratorThe random generator to be used
reusableClusterIndicesForDescriptorsMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be reused internally, must be valid
clustersMeanFunctionThe function allowing to determine the mean descriptors for individual clusters, must be valid
subsetFirstClusterThe index of the first cluster (the first child node) to be handled, with range [0, numberClusters - 1]
subsetNumberClustersThe number of clusters (child nodes) to be handled, with range [1, numberClusters - subsetFirstCluster]

◆ descriptorIndices()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
const Indices32 & Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::descriptorIndices
inline

Returns all indices of descriptors which belong to this tree/node.

Returns
The node's descriptors, empty in non-leaf nodes

◆ determineBestLeaf()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
const Indices32 & Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::determineBestLeaf ( const TDescriptor &  descriptor) const

Determines the leaf best matching with a given descriptor.

Actually this function returns the tree's descriptors within the leaf.

Parameters
descriptorThe descriptor for which the best leaf will be determined
Returns
The indices of the descriptors within the leaf

◆ determineBestLeafs()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::determineBestLeafs ( const TDescriptor &  descriptor,
std::vector< const Indices32 * > &  leafs,
const TDistance  distanceEpsilon = TDistance(0) 
) const

Determines the leafs best matching with a given descriptor.

Actually this function returns the tree's descriptors within the leafs.

Parameters
descriptorThe descriptor for which the best leafs will be determined
leafsThe resulting groups of indices of the descriptors within the leafs, must be empty when calling
distanceEpsilonThe epsilon distance between the currently best node and node candidates

◆ determineClustersMeanForBinaryDescriptor()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<unsigned int tSize>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::determineClustersMeanForBinaryDescriptor ( const unsigned int  numberClusters,
const TDescriptor *  treeDescriptors,
const Index32 descriptorIndices,
const Index32 clusterIndicesForDescriptors,
const size_t  numberDescriptorIndices,
Worker worker 
)
static

Determines a binary mean descriptor for each cluster.

Parameters
numberClustersThe number of clusters, with range [1, infinity)
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
descriptorIndicesThe indices of the individual descriptors wrt. the given descriptors, must be valid
clusterIndicesForDescriptorsThe indices of the clusters to which each individual descriptor belongs (a lookup table with cluster indices), one for each descriptor
numberDescriptorIndicesThe number of provided descriptor indices (the number of descriptors which are part of all clusters), must be valid
workerOptional worker to distribute the computation
Returns
The resulting mean descriptors, one for each cluster
Template Parameters
tSizeThe number of bits per binary descriptor

◆ determineClustersMeanForFloatDescriptor()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<unsigned int tSize>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::determineClustersMeanForFloatDescriptor ( const unsigned int  numberClusters,
const TDescriptor *  treeDescriptors,
const Index32 descriptorIndices,
const Index32 clusterIndicesForDescriptors,
const size_t  numberDescriptorIndices,
Worker worker 
)
static

Determines a float mean descriptor for each cluster.

Parameters
numberClustersThe number of clusters, with range [1, infinity)
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
descriptorIndicesThe indices of the individual descriptors wrt. the given descriptors, must be valid
clusterIndicesForDescriptorsThe indices of the clusters to which each individual descriptor belongs (a lookup table with cluster indices), one for each descriptor
numberDescriptorIndicesThe number of provided descriptor indices (the number of descriptors which are part of all clusters), must be valid
workerOptional worker to distribute the computation
Returns
The resulting mean descriptors, one for each cluster
Template Parameters
tSizeThe number of elements per float descriptor

◆ initialClusters()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::initialClusters ( const Parameters parameters,
const TDescriptor *  treeDescriptors,
Index32 reusableDescriptorIndicesInput,
Index32 reusableDescriptorIndicesOutput,
size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator 
)
protected

Determines the initial clusters based on specified initialization strategy.

Parameters
parametersThe parameters used to construct the tree, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
reusableDescriptorIndicesInputThe indices of the descriptors for which the new clusters will be created, must be valid
reusableDescriptorIndicesOutputMemory block of indices with same size as 'reusableDescriptorIndicesInput' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of provided indices of the tree descriptors, with range [1, infinity)
randomGeneratorThe random generator to be used
Returns
The descriptors of the centers of the initial clusters

◆ initialClustersLargestDistance()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::initialClustersLargestDistance ( const Parameters parameters,
const TDescriptor *  treeDescriptors,
Index32 descriptorIndices,
Index32 reusableIndices,
const size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator 
) const
protected

Determines the initial clusters based on the largest distance between each other.

The first cluster is selected randomly, the following clusters are selected so that they have the largest distance to the existing clusters.

Parameters
parametersThe parameters used to construct the tree, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
descriptorIndicesThe indices of the tree descriptors for which the new clusters will be determined, must be valid
reusableIndicesMemory block of indices with same size as 'descsriptorIndices' which can be re-used internally, must be valid
numberDescriptorsIndicesThe number of provided indices of the tree descriptors, with range [1, infinity)
randomGeneratorThe random generator to be used
Returns
The descriptors of the centers of the initial clusters

◆ initialClustersPureRandom()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::TDescriptors Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::initialClustersPureRandom ( const Parameters parameters,
const TDescriptor *  treeDescriptors,
Index32 descriptorIndices,
const size_t  numberDescriptorsIndices,
RandomGenerator randomGenerator 
) const
protected

Determines the initial cluster based on a pure random choice.

Parameters
parametersThe parameters used to construct the tree, must be valid
treeDescriptorsThe descriptors of the entire tree from which some will be part of the clusters, must be valid
descriptorIndicesThe indices of the tree descriptors for which the new clusters will be determined, must be valid
numberDescriptorsIndicesThe number of provided indices of the tree descriptors, with range [1, infinity)
randomGeneratorThe random generator to be used
Returns
The descriptors of the centers of the initial clusters

◆ matchDescriptor()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
Index32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchDescriptor ( const TDescriptor *  candidateDescriptors,
const TDescriptor &  queryDescriptor,
TDistance *  distance = nullptr,
const ReusableData reusableData = ReusableData() 
) const

Matches a query descriptor with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryDescriptorThe query descriptor for which the best matching tree candidate descriptor will be determined
distanceOptional resulting distance, nullptr if not of interest
reusableDataAn reusable object to speedup the search, should be located outside of the function call if several function calls are done after each other
Returns
The index of the matched tree candidate descriptor, with range [0, 'numberTreeDescriptors' - 1], invalidMatchIndex() if no match could be determined
Template Parameters
tMatchingModeThe mode which is used for matching

◆ matchDescriptors()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchDescriptors ( const TDescriptor *  candidateDescriptors,
const TDescriptor *  queryDescriptors,
const size_t  numberQueryDescriptors,
const TDistance  maximalDistance,
Matches matches,
Worker worker = nullptr 
) const

Matches several query descriptors with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryDescriptorsThe query descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryDescriptors == 0'
numberQueryDescriptorsThe number of given query descriptors, with range [0, infinity)
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
workerOptional worker object to distribute the computation
Template Parameters
tMatchingModeThe mode which is used for matching

◆ matchDescriptorsSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchDescriptorsSubset ( const TDescriptor *  candidateDescriptors,
const TDescriptor *  queryDescriptors,
const TDistance  maximalDistance,
Matches matches,
Lock lock,
const unsigned int  firstQueryDescriptor,
const unsigned int  numberQueryDescriptors 
) const
protected

Matches a subset of several query descriptors with all tree candidate descriptors.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryDescriptorsThe query descriptors for which the best matching tree candidate descriptors will be determined, must be valid
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
lockOptional lock when executed in multiple threads in parallel, nullptr otherwise
firstQueryDescriptorThe index of the first query descriptor to be handled, with range [0, infinity)
numberQueryDescriptorsThe number of query descriptors to be handled, with range [1, infinity)
Template Parameters
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptor() [1/2]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
Index32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptor ( const TDescriptor *  candidateDescriptors,
const TDescriptor *  queryMultiDescriptor,
const size_t  numberQuerySingleDescriptors,
TDistance *  distance = nullptr,
const ReusableData reusableData = ReusableData() 
) const

Matches a query multi-descriptor with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorThe first single descriptor of the query multi-descriptor for which the best matching tree candidate descriptor will be determined
numberQuerySingleDescriptorsThe number of single descriptors within the multi-descriptor, with range [1, infinity)
distanceOptional resulting distance, nullptr if not of interest
reusableDataAn reusable object to speedup the search, should be located outside of the function call if several function calls are done after each other
Returns
The index of the matched tree candidate descriptor, with range [0, 'numberTreeDescriptors' - 1], invalidMatchIndex() if no match could be determined
Template Parameters
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptor() [2/2]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptor , const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
Index32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptor ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptor &  queryMultiDescriptor,
TDistance *  distance = nullptr,
const ReusableData reusableData = ReusableData() 
) const

Matches a query multi-descriptor with all candidate descriptors in this tree.

A feature point can be described with a multi-descriptor if the feature point has been seen from individual distances (to be scale invariant to some extent).

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorThe query multi-descriptor for which the best matching tree candidate descriptor will be determined
distanceOptional resulting distance, nullptr if not of interest
reusableDataAn reusable object to speedup the search, should be located outside of the function call if several function calls are done after each other
Returns
The index of the matched tree candidate descriptor, with range [0, 'numberTreeDescriptors' - 1], invalidMatchIndex() if no match could be determined
Template Parameters
TMultiDescriptorThe data type of the multi-descriptor
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptorGroup()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , const TMultiDescriptor *(*)(const TMultiDescriptorGroup &, const size_t) tMultiDescriptorGroupFunction, const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
Index32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptorGroup ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptorGroup &  queryMultiDescriptorGroup,
TDistance *  distance = nullptr,
const ReusableData reusableData = ReusableData() 
) const

Matches a query group of multi-descriptors with all candidate descriptors in this tree.

A feature point can be described with a group of multi-descriptors if the feature point has been seen from individual locations or at individual moments in time (e.g., day vs. night).

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorGroupThe query group of multi-descriptors (all representing one query feature) for which the best matching tree candidate descriptor will be determined
distanceOptional resulting distance, nullptr if not of interest
reusableDataAn reusable object to speedup the search, should be located outside of the function call if several function calls are done after each other
Returns
The index of the matched tree candidate descriptor, with range [0, 'numberTreeDescriptors' - 1], invalidMatchIndex() if no match could be determined
Template Parameters
TMultiDescriptorGroupThe data type of the multi-descriptor group
TMultiDescriptorThe data type of the multi-descriptor
tMultiDescriptorGroupFunctionThe function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptorGroups()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , const TMultiDescriptor *(*)(const TMultiDescriptorGroup &, const size_t) tMultiDescriptorGroupFunction, const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptorGroups ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptorGroup *  queryMultiDescriptorGroups,
const size_t  numberQueryMultiDescriptorGroups,
const TDistance  maximalDistance,
Matches matches,
Worker worker = nullptr 
) const

Matches several query groups of multi-descriptors with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorGroupsThe query groups of multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0'
numberQueryMultiDescriptorGroupsThe number of given query groups of multi-descriptors, with range [0, infinity)
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
workerOptional worker object to distribute the computation
Template Parameters
TMultiDescriptorGroupThe data type of the multi-descriptor group
TMultiDescriptorThe data type of the multi-descriptor
tMultiDescriptorGroupFunctionThe function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptorGroupsSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptorGroup , typename TMultiDescriptor , const TMultiDescriptor *(*)(const TMultiDescriptorGroup &, const size_t) tMultiDescriptorGroupFunction, const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptorGroupsSubset ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptorGroup *  queryMultiDescriptorGroups,
const TDistance  maximalDistance,
Matches matches,
Lock lock,
const unsigned int  firstQueryMultiDescriptorGroup,
const unsigned int  numberQueryMultiDescriptorGroups 
) const
protected

Matches a subset of several query groups of multi-descriptors with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorGroupsThe query groups of multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0'
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
lockOptional lock when executed in multiple threads in parallel, nullptr otherwise
firstQueryMultiDescriptorGroupThe index of the first query group of multi-descriptors to be handled, with range [0, infinity)
numberQueryMultiDescriptorGroupsThe number of query groups of multi-descriptors to be handled, with range [1, infinity)
Template Parameters
TMultiDescriptorGroupThe data type of the multi-descriptor group
TMultiDescriptorThe data type of the multi-descriptor
tMultiDescriptorGroupFunctionThe function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptors()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptor , const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptors ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptor *  queryMultiDescriptors,
const size_t  numberQueryMultiDescriptors,
const TDistance  maximalDistance,
Matches matches,
Worker worker = nullptr 
) const

Matches several query multi-descriptors with all candidate descriptors in this tree.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorsThe query multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0'
numberQueryMultiDescriptorsThe number of given query multi-descriptors, with range [0, infinity)
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
workerOptional worker object to distribute the computation
Template Parameters
TMultiDescriptorThe data type of a multi-descriptor
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ matchMultiDescriptorsSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptor , const TDescriptor *(*)(const TMultiDescriptor &, const size_t) tMultiDescriptorFunction, VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::matchMultiDescriptorsSubset ( const TDescriptor *  candidateDescriptors,
const TMultiDescriptor *  queryMultiDescriptors,
const TDistance  maximalDistance,
Matches matches,
Lock lock,
const unsigned int  firstQueryMultiDescriptor,
const unsigned int  numberQueryMultiDescriptors 
) const
protected

Matches a subset of several query multi-descriptors with all tree candidate descriptors.

Parameters
candidateDescriptorsThe entire set of tree candidate descriptors which have been used to create the tree, from which the best matching descriptor will be determined, must be valid
queryMultiDescriptorsThe query multi-descriptors for which the best matching tree candidate descriptors will be determined, must be valid
maximalDistanceThe maximal distance between two matching descriptors, with range [0, infinity)
matchesThe resulting matches
lockOptional lock when executed in multiple threads in parallel, nullptr otherwise
firstQueryMultiDescriptorThe index of the first query multi-descriptor to be handled, with range [0, infinity)
numberQueryMultiDescriptorsThe number of query multi-descriptors to be handled, with range [1, infinity)
Template Parameters
TMultiDescriptorThe data type of a multi-descriptor
tMultiDescriptorFunctionThe function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid
tMatchingModeThe mode which is used for matching

◆ nodeDescriptor()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
const TDescriptor & Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::nodeDescriptor
inline

Returns the descriptor representing this tree/node.

Returns
The node's descriptor

◆ operator=() [1/2]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree& Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::operator= ( const VocabularyTree< TDescriptor, TDistance, tDistanceFunction > &  vocabularyTree)
delete

Disabled assign operator.

Parameters
vocabularyTreeThe vocabulary tree to be copied
Returns
Reference to this object

◆ operator=() [2/2]

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
VocabularyTree< TDescriptor, TDistance, tDistanceFunction > & Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::operator= ( VocabularyTree< TDescriptor, TDistance, tDistanceFunction > &&  vocabularyTree)

Move operator.

Parameters
vocabularyTreeThe vocabulary tree to be moved
Returns
Reference to this object

Field Documentation

◆ childNodes_

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Nodes Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::childNodes_
protected

The child-nodes of this node.

◆ descriptorIndices_

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
Indices32 Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::descriptorIndices_
protected

The indices of the descriptors which are part of this node.

◆ distanceFunction

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
constexpr TDistance(* Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::distanceFunction) (const TDescriptor &, const TDescriptor &) = tDistanceFunction
staticconstexpr

The pointer to the function determining the distance between two descriptors of this tree.

◆ level_

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
unsigned int Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::level_ = 0u
protected

The node's level.

◆ nodeDescriptor_

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
TDescriptor Ocean::Tracking::VocabularyTree< TDescriptor, TDistance, tDistanceFunction >::nodeDescriptor_
protected

The node's descriptor.


The documentation for this class was generated from the following file: