Ocean
UnifiedFeatureMap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TRACKING_MAPBUILDING_UNIFIED_FEATURE_MAP_H
9 #define META_OCEAN_TRACKING_MAPBUILDING_UNIFIED_FEATURE_MAP_H
10 
14 
15 #include "ocean/base/Lock.h"
17 #include "ocean/base/WorkerPool.h"
18 
19 #include "ocean/geometry/Octree.h"
20 
21 namespace Ocean
22 {
23 
24 namespace Tracking
25 {
26 
27 namespace MapBuilding
28 {
29 
30 // Forward declaration.
31 class UnifiedFeatureMap;
32 
33 /**
34  * Definition of a shared pointer holding a UnifiedFeatureMap object.
35  * @see UnifiedFeatureMap.
36  * @ingroup trackingmapbuilding
37  */
38 typedef std::shared_ptr<UnifiedFeatureMap> SharedUnifiedFeatureMap;
39 
40 /**
41  * This class implements the base class for a feature map necessary to re-localize with optimized data structures.
42  * @ingroup trackingmapbuilding
43  */
44 class OCEAN_TRACKING_MAPBUILDING_EXPORT UnifiedFeatureMap
45 {
46  public:
47 
48  /**
49  * Disposes the object.
50  */
51  virtual ~UnifiedFeatureMap() = default;
52 
53  /**
54  * Returns the 3D object points of the map.
55  * This function is not thread-safe.
56  * @return The map's 3D object points
57  */
58  inline const Vectors3& objectPoints() const;
59 
60  /**
61  * Returns the ids object point ids, one for each 3D object point.
62  * This function is not thread-safe.
63  * @return The map's object point ids
64  */
65  inline const Indices32& objectPointIds() const;
66 
67  /**
68  * Returns the descriptors of the 3D object points adjusted/optimized for the vocabulary structure.
69  * This function is not thread-safe.
70  * @return The map's vocabulary structure descriptors
71  */
72  inline const UnifiedDescriptors& objectPointVocabularyDescriptors() const;
73 
74  /**
75  * Returns the indices of the corresponding 3D object points, one for each object point descriptor, mainly a map mapping descriptor indices to point indices.
76  * This function is not thread-safe.
77  * @return The map's object point indices
78  */
79  inline const Indices32& objectPointIndices() const;
80 
81  /**
82  * Returns the vocabulary forest holding the descriptors of the object points of the map.
83  * This function is not thread-safe.
84  * @return The map's vocabulary forest
85  */
87 
88  /**
89  * Returns the octree holding the object points of the map.
90  * This function is not thread-safe.
91  * @return The map's octree
92  */
93  inline const Geometry::Octree& objectPointOctree() const;
94 
95  /**
96  * Returns the map mapping object point ids to their associated descriptors.
97  * This function is not thread-safe.
98  * @return The map's descriptor map
99  */
100  inline const Tracking::MapBuilding::UnifiedDescriptorMap& descriptorMap() const;
101 
102  /**
103  * Sets or updates the feature map to be used for relocalization.
104  * @param objectPoints The 3D object points of the feature map
105  * @param objectPointIds The ids of the object points, one for each object point
106  * @param descriptorMap The map mapping object point ids to descriptors, must be valid
107  * @param randomGenerator The random generator object
108  * @return True, if succeeded
109  */
110  virtual bool updateFeatureMap(Vectors3&& objectPoints, Indices32&& objectPointIds, SharedUnifiedDescriptorMap&& descriptorMap, RandomGenerator& randomGenerator) = 0;
111 
112  /**
113  * Creates the unguided matching and the guided matching object and initializes the objects with the necessary information.
114  * @param imagePoints The image points to be used, nullptr to initialize the objects without image points
115  * @param imagePointDescriptors The descriptors of the image points, nullptr to initialize the objects without image points descriptors
116  * @param unifiedUnguidedMatching The resulting unguided matching object
117  * @param unifiedGuidedMatching The resulting guided matching object
118  * @return True, if succeeded
119  */
120  virtual bool createMatchingObjects(const Vector2* imagePoints, const UnifiedDescriptors* imagePointDescriptors, SharedUnifiedUnguidedMatching& unifiedUnguidedMatching, SharedUnifiedGuidedMatching& unifiedGuidedMatching) = 0;
121 
122  /**
123  * Returns whether this feature map holds at least one feature.
124  */
125  inline bool isValid() const;
126 
127  protected:
128 
129  /**
130  * Default constructor creating an invalid feature map.
131  */
132  UnifiedFeatureMap() = default;
133 
134  protected:
135 
136  /// The 3D object points of the map.
138 
139  /// The ids object point ids, one for each 3D object point.
141 
142  /// The descriptors of the 3D object points adjusted for the vocabulary structure.
144 
145  /// The indices of the corresponding 3D object points, one for each object point descriptor, mainly a map mapping descriptor indices to point indices.
147 
148  /// The octree holding the object points of the map.
150 
151  /// The map mapping object point ids to their associated descriptors.
153 
154  /// The feature map's lock.
155  mutable Lock lock_;
156 };
157 
158 /**
159  * This class implements a specialized feature map with specific descriptor types.
160  * @tparam TImagePointDescriptor The data type of the image point descriptors
161  * @tparam TObjectPointDescriptor The data type of the object point descriptors
162  * @tparam TObjectPointVocabularyDescriptor The data type of the vocabulary descriptors representing the object point descriptors, must be a single-level, single-view descriptor
163  * @tparam TDescriptorDistance The data type of the distance between two vocabulary descriptors, e.g., 'uint32_t' or 'float'
164  * @tparam tVocabularyDistanceFunction The function pointer to a function allowing to determine the descriptor distance between two vocabulary descriptors
165  * @ingroup trackingmapbuilding
166  */
167 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance = typename UnifiedDescriptor::DistanceTyper<TObjectPointVocabularyDescriptor>::Type, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&) = UnifiedDescriptorT<TObjectPointVocabularyDescriptor>::determineDistance>
169 {
170  public:
171 
172  /**
173  * Definition of a vocabulary forest used for unguided pose estimation.
174  */
176 
177  /**
178  * Definition of a vector holding vocabulary descriptors.
179  */
180  using TObjectPointVocabularyDescriptors = std::vector<TObjectPointVocabularyDescriptor>;
181 
182  /**
183  * Definition of a function allowing to serialize the features from a descriptor map so that the features can be processed with a vocabulary tree/forest.
184  * @param descriptorMap The descriptor map containing the features to serialize
185  * @param objectPoints The resulting 3D object points
186  * @param objectPointIds The resulting ids of all 3D object points
187  * @param objectPointIndices The resulting indices of 3D object points, allowing to map extracted vocabulary descriptors to object points (e.g., because the given object point descriptor may be multi-level or/and multi-view descriptors
188  * @param vocabularyDescriptors The resulting descriptors for the vocabulary tree, must be single-view, single-level descriptors
189  * @return True, if succeeded
190  */
191  using ExtractVocabularyDescriptorsFromMapFunction = std::function<bool(const UnifiedDescriptorMap& descriptorMap, Vectors3& objectPoints, Indices32& objectPointIds, Indices32& objectPointIndices, TObjectPointVocabularyDescriptors& vocabularyDescriptors)>;
192 
193  public:
194 
195  /**
196  * Creates a new unified feature map object.
197  * @param objectPoints The 3D object points to be used
198  * @param objectPointIds The ids of the object points, one for each object point
199  * @param descriptorMap The map containing the descriptors of the object points
200  * @param randomGenerator The random generator to be used
201  * @param clustersMeanFunction The function allowing to determine the mean descriptors for individual clusters, must be valid
202  * @param extractVocabularyDescriptorsFromMapFunction The function allowing to extract the 3D object point descriptors from the feature map and creating serialized descriptors which can be processed in the vocabulary tree, must be valid
203  */
204  UnifiedFeatureMapT(Vectors3&& objectPoints, Indices32&& objectPointIds, SharedUnifiedDescriptorMap&& descriptorMap, RandomGenerator& randomGenerator, typename VocabularyForest::ClustersMeanFunction clustersMeanFunction, ExtractVocabularyDescriptorsFromMapFunction extractVocabularyDescriptorsFromMapFunction);
205 
206  /**
207  * Returns the descriptors of the object points used in the vocabulary tree.
208  * @return The vocabulary tree's descriptors
209  */
210  const TObjectPointVocabularyDescriptor* objectPointVocabularyDescriptors() const;
211 
212  /**
213  * Returns the vocabulary forest holding the descriptors of the object points of the map.
214  * This function is not thread-safe.
215  * @return The map's vocabulary forest
216  */
217  const VocabularyForest& objectPointDescriptorsForest() const override;
218 
219  /**
220  * Sets or updates the feature map to be used for relocalization.
221  * @see UnifiedFeatureMap::updateFeatureMap().
222  */
223  bool updateFeatureMap(Vectors3&& objectPoints, Indices32&& objectPointIds, SharedUnifiedDescriptorMap&& descriptorMap, RandomGenerator& randomGenerator) override;
224 
225  /**
226  * Creates the unguided matching and the guided matching object and initializes the objects with the necessary information.
227  * @see UnifiedFeatureMap::createMatchingObjects().
228  */
229  bool createMatchingObjects(const Vector2* imagePoints, const UnifiedDescriptors* imagePointDescriptors, SharedUnifiedUnguidedMatching& unifiedUnguidedMatching, SharedUnifiedGuidedMatching& unifiedGuidedMatching) override;
230 
231  protected:
232 
233  /// The function allowing to determine the mean descriptors for individual clusters.
235 
236  /// The function allowing to extract the 3D object point descriptors from the feature map and creating serialized descriptors which can be processed in the vocabulary tree.
238 
239  /// The vocabulary forest holding the descriptors of the object points of the map.
241 };
242 
244 {
245  return objectPoints_;
246 }
247 
249 {
250  return objectPointIds_;
251 }
252 
254 {
255  ocean_assert(objectPointVocabularyDescriptors_ != nullptr);
257 }
258 
260 {
261  return objectPointIndices_;
262 }
263 
265 {
266  return objectPointOctree_;
267 }
268 
270 {
271  ocean_assert(descriptorMap_ != nullptr);
272  return *descriptorMap_;
273 }
274 
275 inline bool UnifiedFeatureMap::isValid() const
276 {
277  const ScopedLock scopedLock(lock_);
278 
279  return !objectPoints_.empty() && objectPointVocabularyDescriptors_ != nullptr;
280 }
281 
282 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&)>
284  clustersMeanFunction_(std::move(clustersMeanFunction)),
285  extractVocabularyDescriptorsFromMapFunction_(std::move(extractVocabularyDescriptorsFromMapFunction))
286 {
287  ocean_assert(clustersMeanFunction_);
289 
290  const bool result = updateFeatureMap(std::move(objectPoints), std::move(objectPointIds), std::move(descriptorMap), randomGenerator);
291  ocean_assert_and_suppress_unused(result, result);
292 }
293 
294 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&)>
296 {
297  if (!objectPointVocabularyDescriptors_)
298  {
299  return nullptr;
300  }
301 
302  if (objectPointVocabularyDescriptors_->descriptorType() != UnifiedDescriptor::DescriptorTyper<TObjectPointVocabularyDescriptor>::type())
303  {
304  ocean_assert(false && "This should never happen!");
305  return nullptr;
306  }
307 
308  const UnifiedDescriptorsT<TObjectPointVocabularyDescriptor>* vocabularyDescriptors = dynamic_cast<const UnifiedDescriptorsT<TObjectPointVocabularyDescriptor>*>(objectPointVocabularyDescriptors_.get());
309 
310  if (vocabularyDescriptors == nullptr)
311  {
312  ocean_assert(false && "This should never happen!");
313  return nullptr;
314  }
315 
316  return vocabularyDescriptors->descriptors();
317 }
318 
319 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&)>
321 {
322  return objectPointDescriptorsForest_;
323 }
324 
325 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&)>
327 {
328  if (!extractVocabularyDescriptorsFromMapFunction_)
329  {
330  return false;
331  }
332 
333  if (objectPoints.empty() || objectPointIds.empty() || !descriptorMap)
334  {
335  return false;
336  }
337 
338  if (objectPoints.size() != objectPointIds.size())
339  {
340  return false;
341  }
342 
343  const ScopedLock scopedLock(lock_);
344 
345  objectPointVocabularyDescriptors_ = nullptr;
346  objectPointIndices_.clear();
347  descriptorMap_ = nullptr;
348 
349  objectPoints_ = std::move(objectPoints);
350  objectPointIds_ = std::move(objectPointIds);
351  descriptorMap_ = std::move(descriptorMap);
352 
353  ocean_assert(descriptorMap_);
354 
355  TObjectPointVocabularyDescriptors objectPointVocabularyDescriptors;
356 
357  if (!extractVocabularyDescriptorsFromMapFunction_(*descriptorMap_, objectPoints_, objectPointIds_, objectPointIndices_, objectPointVocabularyDescriptors))
358  {
359  return false;
360  }
361 
362  using UnifiedDescriptorsVocabulary = UnifiedDescriptorsT<TObjectPointVocabularyDescriptor>;
363 
364  objectPointVocabularyDescriptors_ = std::make_shared<UnifiedDescriptorsVocabulary>(std::move(objectPointVocabularyDescriptors));
365 
366  const UnifiedDescriptorsVocabulary& unifiedDescriptorsVocabulary = dynamic_cast<const UnifiedDescriptorsVocabulary&>(*objectPointVocabularyDescriptors_);
367 
368  const typename VocabularyForest::Parameters parameters;
369 
370  objectPointDescriptorsForest_ = VocabularyForest(2, unifiedDescriptorsVocabulary.descriptors(), unifiedDescriptorsVocabulary.numberDescriptors(), clustersMeanFunction_, parameters, WorkerPool::get().scopedWorker()(), &randomGenerator);
371 
372  objectPointOctree_ = Geometry::Octree(objectPoints_.data(), objectPoints_.size(), Geometry::Octree::Parameters(40u, true));
373 
374  return true;
375 }
376 
377 template <typename TImagePointDescriptor, typename TObjectPointDescriptor, typename TObjectPointVocabularyDescriptor, typename TDescriptorDistance, TDescriptorDistance(*tVocabularyDistanceFunction)(const TObjectPointVocabularyDescriptor&, const TObjectPointVocabularyDescriptor&)>
379 {
380  ocean_assert((imagePoints != nullptr && imagePointDescriptors != nullptr) || (imagePoints == nullptr && imagePointDescriptors == nullptr));
381 
382  const UnifiedDescriptorMapT<TObjectPointDescriptor>* specializedDescriptorMap = dynamic_cast<const UnifiedDescriptorMapT<TObjectPointDescriptor>*>(descriptorMap_.get());
383 
384  if (specializedDescriptorMap == nullptr)
385  {
386  ocean_assert(false && "This should never happen!");
387  return false;
388  }
389 
392 
393  if (imagePoints != nullptr)
394  {
395  const UnifiedDescriptorsT<TImagePointDescriptor>* specializedImagePointDescriptors = dynamic_cast<const UnifiedDescriptorsT<TImagePointDescriptor>*>(imagePointDescriptors);
396 
397  if (specializedImagePointDescriptors == nullptr)
398  {
399  return false;
400  }
401 
402  unifiedUnguidedMatching = std::make_shared<UnifiedUnguidedMatching>(imagePoints, specializedImagePointDescriptors->descriptors(), specializedImagePointDescriptors->numberDescriptors(), objectPoints_.data(), objectPointVocabularyDescriptors(), objectPoints_.size(), objectPointIndices_.data(), objectPointDescriptorsForest());
403  unifiedGuidedMatching = std::make_shared<UnifiedGuidedMatching>(imagePoints, specializedImagePointDescriptors->descriptors(), specializedImagePointDescriptors->numberDescriptors(), objectPoints_.data(), objectPoints_.size(), objectPointOctree_, objectPointIds_.data(), specializedDescriptorMap->descriptorMap());
404  }
405  else
406  {
407  unifiedUnguidedMatching = std::make_shared<UnifiedUnguidedMatching>(objectPoints_.data(), objectPointVocabularyDescriptors(), objectPoints_.size(), objectPointIndices_.data(), objectPointDescriptorsForest());
408  unifiedGuidedMatching = std::make_shared<UnifiedGuidedMatching>(objectPoints_.data(), objectPoints_.size(), objectPointOctree_, objectPointIds_.data(), specializedDescriptorMap->descriptorMap());
409  }
410 
411  return unifiedUnguidedMatching && unifiedGuidedMatching;
412 }
413 
414 }
415 
416 }
417 
418 }
419 
420 #endif // META_OCEAN_TRACKING_MAPBUILDING_UNIFIED_FEATURE_MAP_H
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a generator for random numbers.
Definition: RandomGenerator.h:42
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
static WorkerPool & get()
Returns a reference to the unique object.
Definition: Singleton.h:115
This class implements a helper class allowing to determine the descriptor type value for a descriptor...
Definition: UnifiedDescriptor.h:177
This class implements the base class for all unified descriptor maps in which ids are mapped to descr...
Definition: UnifiedDescriptorMap.h:38
This class implements the descriptor map for arbitrary descriptors.
Definition: UnifiedDescriptorMap.h:94
const DescriptorMap & descriptorMap() const
Returns the actual underlying descriptor map.
Definition: UnifiedDescriptorMap.h:204
This class implements the base class for unified descriptor objects with specific descriptor type.
Definition: UnifiedDescriptor.h:595
This class implements the base class for all unified descriptor buffers stored in a continuous memory...
Definition: UnifiedDescriptors.h:29
This class implements a type-based container for descriptors stored in a continuous memory like a vec...
Definition: UnifiedDescriptors.h:71
const TDescriptor * descriptors() const
Returns the pointer to the memory holding all descriptors of this object.
Definition: UnifiedDescriptors.h:149
size_t numberDescriptors() const override
Returns the number of descriptors this object holds.
Definition: UnifiedDescriptors.h:155
This class implements the base class for a feature map necessary to re-localize with optimized data s...
Definition: UnifiedFeatureMap.h:45
SharedUnifiedDescriptorMap descriptorMap_
The map mapping object point ids to their associated descriptors.
Definition: UnifiedFeatureMap.h:152
Indices32 objectPointIndices_
The indices of the corresponding 3D object points, one for each object point descriptor,...
Definition: UnifiedFeatureMap.h:146
Vectors3 objectPoints_
The 3D object points of the map.
Definition: UnifiedFeatureMap.h:137
Geometry::Octree objectPointOctree_
The octree holding the object points of the map.
Definition: UnifiedFeatureMap.h:149
const UnifiedDescriptors & objectPointVocabularyDescriptors() const
Returns the descriptors of the 3D object points adjusted/optimized for the vocabulary structure.
Definition: UnifiedFeatureMap.h:253
virtual ~UnifiedFeatureMap()=default
Disposes the object.
const Geometry::Octree & objectPointOctree() const
Returns the octree holding the object points of the map.
Definition: UnifiedFeatureMap.h:264
Lock lock_
The feature map's lock.
Definition: UnifiedFeatureMap.h:155
SharedUnifiedDescriptors objectPointVocabularyDescriptors_
The descriptors of the 3D object points adjusted for the vocabulary structure.
Definition: UnifiedFeatureMap.h:143
Indices32 objectPointIds_
The ids object point ids, one for each 3D object point.
Definition: UnifiedFeatureMap.h:140
UnifiedFeatureMap()=default
Default constructor creating an invalid feature map.
const Tracking::MapBuilding::UnifiedDescriptorMap & descriptorMap() const
Returns the map mapping object point ids to their associated descriptors.
Definition: UnifiedFeatureMap.h:269
bool isValid() const
Returns whether this feature map holds at least one feature.
Definition: UnifiedFeatureMap.h:275
const Indices32 & objectPointIndices() const
Returns the indices of the corresponding 3D object points, one for each object point descriptor,...
Definition: UnifiedFeatureMap.h:259
virtual const Tracking::VocabularyStructure & objectPointDescriptorsForest() const =0
Returns the vocabulary forest holding the descriptors of the object points of the map.
const Vectors3 & objectPoints() const
Returns the 3D object points of the map.
Definition: UnifiedFeatureMap.h:243
virtual bool createMatchingObjects(const Vector2 *imagePoints, const UnifiedDescriptors *imagePointDescriptors, SharedUnifiedUnguidedMatching &unifiedUnguidedMatching, SharedUnifiedGuidedMatching &unifiedGuidedMatching)=0
Creates the unguided matching and the guided matching object and initializes the objects with the nec...
virtual bool updateFeatureMap(Vectors3 &&objectPoints, Indices32 &&objectPointIds, SharedUnifiedDescriptorMap &&descriptorMap, RandomGenerator &randomGenerator)=0
Sets or updates the feature map to be used for relocalization.
const Indices32 & objectPointIds() const
Returns the ids object point ids, one for each 3D object point.
Definition: UnifiedFeatureMap.h:248
This class implements a specialized feature map with specific descriptor types.
Definition: UnifiedFeatureMap.h:169
std::function< bool(const UnifiedDescriptorMap &descriptorMap, Vectors3 &objectPoints, Indices32 &objectPointIds, Indices32 &objectPointIndices, TObjectPointVocabularyDescriptors &vocabularyDescriptors)> ExtractVocabularyDescriptorsFromMapFunction
Definition of a function allowing to serialize the features from a descriptor map so that the feature...
Definition: UnifiedFeatureMap.h:191
bool createMatchingObjects(const Vector2 *imagePoints, const UnifiedDescriptors *imagePointDescriptors, SharedUnifiedUnguidedMatching &unifiedUnguidedMatching, SharedUnifiedGuidedMatching &unifiedGuidedMatching) override
Creates the unguided matching and the guided matching object and initializes the objects with the nec...
Definition: UnifiedFeatureMap.h:378
ExtractVocabularyDescriptorsFromMapFunction extractVocabularyDescriptorsFromMapFunction_
The function allowing to extract the 3D object point descriptors from the feature map and creating se...
Definition: UnifiedFeatureMap.h:237
const TObjectPointVocabularyDescriptor * objectPointVocabularyDescriptors() const
Returns the descriptors of the object points used in the vocabulary tree.
Definition: UnifiedFeatureMap.h:295
std::vector< TObjectPointVocabularyDescriptor > TObjectPointVocabularyDescriptors
Definition of a vector holding vocabulary descriptors.
Definition: UnifiedFeatureMap.h:180
VocabularyForest::ClustersMeanFunction clustersMeanFunction_
The function allowing to determine the mean descriptors for individual clusters.
Definition: UnifiedFeatureMap.h:234
bool updateFeatureMap(Vectors3 &&objectPoints, Indices32 &&objectPointIds, SharedUnifiedDescriptorMap &&descriptorMap, RandomGenerator &randomGenerator) override
Sets or updates the feature map to be used for relocalization.
Definition: UnifiedFeatureMap.h:326
VocabularyForest objectPointDescriptorsForest_
The vocabulary forest holding the descriptors of the object points of the map.
Definition: UnifiedFeatureMap.h:240
UnifiedFeatureMapT(Vectors3 &&objectPoints, Indices32 &&objectPointIds, SharedUnifiedDescriptorMap &&descriptorMap, RandomGenerator &randomGenerator, typename VocabularyForest::ClustersMeanFunction clustersMeanFunction, ExtractVocabularyDescriptorsFromMapFunction extractVocabularyDescriptorsFromMapFunction)
Creates a new unified feature map object.
Definition: UnifiedFeatureMap.h:283
const VocabularyForest & objectPointDescriptorsForest() const override
Returns the vocabulary forest holding the descriptors of the object points of the map.
Definition: UnifiedFeatureMap.h:320
This class implements the base class for all guided matching objects.
Definition: UnifiedMatching.h:166
This class implements the guided matching object for specific features.
Definition: UnifiedMatching.h:285
This class implements the base class for all unguided matching objects.
Definition: UnifiedMatching.h:227
This class implements the unguided matching object for FREAK Multi features with 32 bytes or 256 bits...
Definition: UnifiedMatching.h:382
This class implements a Vocabulary Forest holding several Vocabulary Trees.
Definition: VocabularyTree.h:766
TDescriptors(*)(const unsigned int numberClusters, const TDescriptor *treeDescriptors, const Index32 *descriptorIndices, const Index32 *clusterIndicesForDescriptors, const size_t numberDescriptorIndices, Worker *worker) ClustersMeanFunction
Definition of a function pointer allowing to determine the mean descriptors for individual clusters.
Definition: VocabularyTree.h:813
This class stores construction parameters for a VocabularyStructure.
Definition: VocabularyTree.h:150
This class implements the base class for all Vocabulary objects.
Definition: VocabularyTree.h:42
ScopedWorker scopedWorker()
Returns a scoped object holding the real worker if available.
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
OctreeT< Scalar > Octree
Definition of an Octree using Scalar as data type.
Definition: Octree.h:25
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
std::shared_ptr< UnifiedGuidedMatching > SharedUnifiedGuidedMatching
Definition of a shared pointer holding an UnifiedGuidedMatching object.
Definition: UnifiedMatching.h:220
std::shared_ptr< UnifiedDescriptorMap > SharedUnifiedDescriptorMap
Definition of a shared pointer holding a UnifiedDescriptorMap object.
Definition: UnifiedDescriptorMap.h:30
std::shared_ptr< UnifiedFeatureMap > SharedUnifiedFeatureMap
Definition of a shared pointer holding a UnifiedFeatureMap object.
Definition: UnifiedFeatureMap.h:31
std::shared_ptr< UnifiedUnguidedMatching > SharedUnifiedUnguidedMatching
Definition of a shared pointer holding an UnifiedUnguidedMatching object.
Definition: UnifiedMatching.h:274
std::shared_ptr< UnifiedDescriptors > SharedUnifiedDescriptors
Definition of a shared pointer holding a UnifiedDescriptors object.
Definition: UnifiedDescriptors.h:63
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15