|
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...
|
|
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...
|
|
|
| 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 ¶meters=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...
|
|
virtual | ~VocabularyStructure ()=default |
| Destructs this object. 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 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...
|
|
| VocabularyStructure ()=default |
| Default constructor. More...
|
|
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
-
TDescriptor | The data type of the descriptors for which the tree will be created |
TDistance | The data type of the distance measure between two descriptors, e.g., 'unsigned int', 'float' |
tDistanceFunction | The pointers to the function able to calculate the distance between two descriptors |
- See also
- VocabularyTree
template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptor >
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
template<typename TDescriptor , typename TDistance , TDistance(*)(const TDescriptor &, const TDescriptor &) tDistanceFunction>
template<typename TMultiDescriptorGroup , typename TMultiDescriptor >
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
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>
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
-
candidateDescriptors | The 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 |
queryMultiDescriptorGroup | The query group of multi-descriptors (all representing one query feature) for which the best matching tree candidate descriptor will be determined |
distance | Optional resulting distance, nullptr if not of interest |
reusableData | An 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
-
TMultiDescriptorGroup | The data type of the multi-descriptor group |
TMultiDescriptor | The data type of the multi-descriptor |
tMultiDescriptorGroupFunction | The function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid |
tMultiDescriptorFunction | The function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid |
tMatchingMode | The mode which is used for matching |
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
-
candidateDescriptors | The 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 |
queryMultiDescriptorGroups | The query groups of multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0' |
numberQueryMultiDescriptorGroups | The number of given query groups of multi-descriptors, with range [0, infinity) |
maximalDistance | The maximal distance between two matching descriptors, with range [0, infinity) |
matches | The resulting matches |
worker | Optional worker object to distribute the computation |
- Template Parameters
-
TMultiDescriptorGroup | The data type of the multi-descriptor group |
TMultiDescriptor | The data type of the multi-descriptor |
tMultiDescriptorGroupFunction | The function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid |
tMultiDescriptorFunction | The function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid |
tMatchingMode | The mode which is used for matching |
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
-
candidateDescriptors | The 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 |
queryMultiDescriptorGroups | The query groups of multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0' |
maximalDistance | The maximal distance between two matching descriptors, with range [0, infinity) |
matches | The resulting matches |
lock | Optional lock when executed in multiple threads in parallel, nullptr otherwise |
firstQueryMultiDescriptorGroup | The index of the first query group of multi-descriptors to be handled, with range [0, infinity) |
numberQueryMultiDescriptorGroups | The number of query groups of multi-descriptors to be handled, with range [1, infinity) |
- Template Parameters
-
TMultiDescriptorGroup | The data type of the multi-descriptor group |
TMultiDescriptor | The data type of the multi-descriptor |
tMultiDescriptorGroupFunction | The function pointer to a static function allowing to access one multi-descriptor of a group of multi-descriptors, must be valid |
tMultiDescriptorFunction | The function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid |
tMatchingMode | The mode which is used for matching |
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
-
candidateDescriptors | The 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 |
queryMultiDescriptors | The query multi-descriptors for which the best matching tree candidate descriptors will be determined, can be nullptr if 'numberQueryMultiDescriptors == 0' |
numberQueryMultiDescriptors | The number of given query multi-descriptors, with range [0, infinity) |
maximalDistance | The maximal distance between two matching descriptors, with range [0, infinity) |
matches | The resulting matches |
worker | Optional worker object to distribute the computation |
- Template Parameters
-
TMultiDescriptor | The data type of a multi-descriptor |
tMultiDescriptorFunction | The function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid |
tMatchingMode | The mode which is used for matching |
- See also
- VocabularyTree::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 >::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
-
candidateDescriptors | The 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 |
queryMultiDescriptors | The query multi-descriptors for which the best matching tree candidate descriptors will be determined, must be valid |
maximalDistance | The maximal distance between two matching descriptors, with range [0, infinity) |
matches | The resulting matches |
lock | Optional lock when executed in multiple threads in parallel, nullptr otherwise |
firstQueryMultiDescriptor | The index of the first query multi-descriptor to be handled, with range [0, infinity) |
numberQueryMultiDescriptors | The number of query multi-descriptors to be handled, with range [1, infinity) |
- Template Parameters
-
TMultiDescriptor | The data type of a multi-descriptor |
tMultiDescriptorFunction | The function pointer to a static function allowing to access one single-descriptor of a multi-descriptor, must be valid |
tMatchingMode | The mode which is used for matching |