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

This class implements a Vocabulary Forest holding several Vocabulary Trees. More...

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

Public Types

typedef TDescriptor Descriptor
 The descriptor type of this forest. More...
 
typedef TDistance Distance
 The distance data type of this forest. 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 > TVocabularyTree
 Definition of the Vocabulary Tree object. 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...
 
using ReusableData = typename TVocabularyTree::ReusableData
 Re-definition of the ReusableData object. 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

 VocabularyForest ()=default
 Creates a new empty forest without trees. More...
 
 VocabularyForest (const size_t numberTrees, const TDescriptor *treeDescriptors, const size_t numberTreeDescriptors, const ClustersMeanFunction &clustersMeanFunction, const Parameters &parameters=Parameters(), Worker *worker=nullptr, RandomGenerator *randomGenerator=nullptr)
 Creates a new forest with several trees for given descriptors. 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 forest. 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 forest. 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 forest. 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 forest. 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 forest. 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 forest. 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 forest. More...
 
- Public Member Functions inherited from Ocean::Tracking::VocabularyStructure
virtual ~VocabularyStructure ()=default
 Destructs this object. 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 forest. More...
 

Protected Types

typedef std::vector< TVocabularyTreeTVocabularyTrees
 Definition of a vector holding VocabularyTree objects. More...
 

Protected Member Functions

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 forest 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 forest 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 forest. More...
 
- Protected Member Functions inherited from Ocean::Tracking::VocabularyStructure
 VocabularyStructure ()=default
 Default constructor. More...
 

Protected Attributes

TVocabularyTrees vocabularyTrees_
 The trees of this forest. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Tracking::VocabularyStructure
static constexpr Index32 invalidMatchIndex ()
 Returns an invalid matching index. 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...
 

Detailed Description

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

This class implements a Vocabulary Forest holding several Vocabulary Trees.

Using several trees with individual clustering can increase the probability to determine the correct descriptor.

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
VocabularyTree

Member Typedef Documentation

◆ ClustersMeanFunction

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyForest< 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().

◆ Descriptor

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

The descriptor type of this forest.

◆ Distance

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

The distance data type of this forest.

◆ Match

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyForest< 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::VocabularyForest< 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::VocabularyForest< 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::VocabularyForest< 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

◆ ReusableData

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
using Ocean::Tracking::VocabularyForest< TDescriptor, TDistance, tDistanceFunction >::ReusableData = typename TVocabularyTree::ReusableData

Re-definition of the ReusableData object.

◆ TDescriptors

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<TDescriptor> Ocean::Tracking::VocabularyForest< 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::VocabularyForest< TDescriptor, TDistance, tDistanceFunction >::TDistances

Definition of a vector holding distances.

◆ TVocabularyTree

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

Definition of the Vocabulary Tree object.

◆ TVocabularyTrees

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
typedef std::vector<TVocabularyTree> Ocean::Tracking::VocabularyForest< TDescriptor, TDistance, tDistanceFunction >::TVocabularyTrees
protected

Definition of a vector holding VocabularyTree objects.

Constructor & Destructor Documentation

◆ VocabularyForest() [1/2]

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

Creates a new empty forest without trees.

◆ VocabularyForest() [2/2]

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

Creates a new forest with several trees for given descriptors.

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

Parameters
numberTreesThe number of trees to be created within the forest, with range [1, infinity)
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 forest, must be valid
workerOptional worker object to distribute the computation
randomGeneratorOptional explicit random generator object

Member Function Documentation

◆ matchDescriptor()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
Index32 Ocean::Tracking::VocabularyForest< 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 forest.

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
See also
VocabularyTree::matchDescriptor().

◆ matchDescriptors()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyForest< 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 forest.

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
See also
VocabularyTree::matchDescriptors().

◆ matchDescriptorsSubset()

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<VocabularyStructure::MatchingMode tMatchingMode>
void Ocean::Tracking::VocabularyForest< 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 forest 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::VocabularyForest< 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 forest.

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
See also
VocabularyTree::matchMultiDescriptor().

◆ 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::VocabularyForest< 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 forest.

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
See also
VocabularyTree::matchMultiDescriptor().

◆ 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::VocabularyForest< 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 forest.

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::VocabularyForest< 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 forest.

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::VocabularyForest< 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 forest.

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::VocabularyForest< 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 forest.

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
See also
VocabularyTree::matchMultiDescriptors().

◆ 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::VocabularyForest< 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 forest 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

Field Documentation

◆ distanceFunction

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

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

◆ vocabularyTrees_

template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
TVocabularyTrees Ocean::Tracking::VocabularyForest< TDescriptor, TDistance, tDistanceFunction >::vocabularyTrees_
protected

The trees of this forest.


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