8#ifndef META_OCEAN_TRACKING_RMV_RMV_FEATURE_MAP_H
9#define META_OCEAN_TRACKING_RMV_RMV_FEATURE_MAP_H
46 inline const Vectors3& objectPoints()
const;
54 inline const Vectors3& initializationObjectPoints()
const;
60 inline const Indices32& recentStrongObjectPointIndices()
const;
66 inline const Indices32& recentSemiStrongObjectPointIndices()
const;
72 inline const Indices32& recentUsedObjectPointIndices()
const;
80 inline Vectors3 recentUsedObjectPoints(
const size_t maxNumber =
size_t(-1))
const;
88 inline void setMostRecentObjectPointIndices(
Indices32&& strongObjectPointIndices,
Indices32&& semiStrongObjectPointIndices,
Indices32&& usedObjectPointIndices);
94 inline void clearMostRecentObjectPointIndices();
101 inline const Box3& boundingBox()
const;
107 inline const AnyCamera& initializationCamera()
const;
128 inline const Box3& initializationBoundingBox()
const;
193 inline bool isEmpty()
const;
199 explicit inline operator bool()
const;
283 ocean_assert(maxNumber != 0);
289 for (
size_t n = 0; n < number; ++n)
304 for (
const Index32& strongIndex : strongObjectPointIndices)
308 for (
const Index32& semiStrongIndex : semiStrongObjectPointIndices)
310 if (strongIndex == semiStrongIndex)
317 ocean_assert(!found);
322 for (
size_t n = 1; n < strongObjectPointIndices.size(); ++n)
324 ocean_assert(strongObjectPointIndices[n - 1] < strongObjectPointIndices[n]);
327 for (
size_t n = 1; n < semiStrongObjectPointIndices.size(); ++n)
329 ocean_assert(semiStrongObjectPointIndices[n - 1] < semiStrongObjectPointIndices[n]);
332 for (
size_t n = 1; n < usedObjectPointIndices.size(); ++n)
334 ocean_assert(usedObjectPointIndices[n - 1] < usedObjectPointIndices[n]);
383inline RMVFeatureMap::operator bool()
const
385 return !mapObjectPoints_.empty();
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:131
bool isValid() const
Returns whether the bounding box is valid.
This class implements Ocean's image class.
Definition Frame.h:1879
DetectorType
Definition of individual feature detectors.
Definition RMVFeatureDetector.h:41
This class implements a feature map.
Definition RMVFeatureMap.h:33
const Box3 & initializationBoundingBox() const
Returns the bounding box of the initialization feature map.
Definition RMVFeatureMap.h:373
void setMostRecentObjectPointIndices(Indices32 &&strongObjectPointIndices, Indices32 &&semiStrongObjectPointIndices, Indices32 &&usedObjectPointIndices)
Sets or changes the indices of the most recently object points.
Definition RMVFeatureMap.h:298
RMVFeatureDetector::DetectorType mapInitializationDetectorType_
Detector type explicitly used for initialization features.
Definition RMVFeatureMap.h:252
Vectors3 mapInitializationObjectPoints_
Object points defining the initialization feature map.
Definition RMVFeatureMap.h:225
Vectors3 recentUsedObjectPoints(const size_t maxNumber=size_t(-1)) const
Returns the most recently used object points.
Definition RMVFeatureMap.h:281
const Box3 & boundingBox() const
Returns the bounding box of this map.
Definition RMVFeatureMap.h:351
RMVFeatureDetector::DetectorType mapDetectorType_
Detector type used for the normal feature map features.
Definition RMVFeatureMap.h:249
void setInitializationFeatures(const Vector3 *objectPoints, const size_t number, const SharedAnyCamera &initializationCamera, const RMVFeatureDetector::DetectorType initializationDetectorType)
Sets or replaces the initialization features for this feature map by a given set of 3D features point...
static Box2 projectToImageIF(const AnyCamera &camera, const HomogenousMatrix4 &flippedCamera_T_world, const Box3 &objectBoundingBox)
Projects a 3D bounding box into the image plane of a given camera.
const Indices32 & recentUsedObjectPointIndices() const
Returns the indices of the most recently used object points.
Definition RMVFeatureMap.h:275
void setFeatures(const Vector3 *points, const size_t number, const SharedAnyCamera &camera, const RMVFeatureDetector::DetectorType detectorType)
Sets or replaces the features for this feature map by a given set of 3D features points.
bool isEmpty() const
Returns whether this feature map holds no feature points.
Definition RMVFeatureMap.h:378
void clearMostRecentObjectPointIndices()
Removes / clears the indices of the most recently object points.
Definition RMVFeatureMap.h:344
Indices32 mapRecentStrongObjectPointIndices_
Indices of the strongest object points from the most recently tracking iteration.
Definition RMVFeatureMap.h:228
const Indices32 & recentStrongObjectPointIndices() const
Returns the indices of the most recently strong object points.
Definition RMVFeatureMap.h:265
const Indices32 & recentSemiStrongObjectPointIndices() const
Returns the indices of the most recently semi-strong object points.
Definition RMVFeatureMap.h:270
SharedAnyCamera mapCamera_
Standard camera.
Definition RMVFeatureMap.h:243
const Vectors3 & initializationObjectPoints() const
Returns the object points to be used during initialization iterations.
Definition RMVFeatureMap.h:260
Vectors3 mapObjectPoints_
Object points defining the feature map.
Definition RMVFeatureMap.h:222
const AnyCamera & initializationCamera() const
Returns the initialization camera if defined.
Definition RMVFeatureMap.h:356
bool setFeatures(const Frame &pattern, const Vector3 &dimension, const SharedAnyCamera &camera, const size_t numberFeatures, const RMVFeatureDetector::DetectorType detectorType, Worker *worker=nullptr)
Sets or replaces the features for this feature map by a given tracking pattern.
Box3 mapInitializationBoundingBox_
Bounding box covering all initialization feature points, if existing.
Definition RMVFeatureMap.h:240
bool setInitializationFeatures(const Frame &pattern, const Vector3 &dimension, const SharedAnyCamera &camera, const size_t numberInitializationObjectPoints, const RMVFeatureDetector::DetectorType &initializationDetectorType, Worker *worker=nullptr)
Sets or replaces the features that will be used during the initialization only for this feature map b...
SharedAnyCamera mapInitializationCamera_
Camera object explicitly used for camera initialization, if defined.
Definition RMVFeatureMap.h:246
RMVFeatureDetector::DetectorType detectorType() const
Returns the detector type for the normal feature map.
Definition RMVFeatureMap.h:368
Indices32 mapRecentUsedObjectPointIndices_
Indices of the used object points from the most recently tracking iteration.
Definition RMVFeatureMap.h:234
Box3 mapBoundingBox_
Bounding box covering all feature points.
Definition RMVFeatureMap.h:237
void clear()
Removes all registered map feature points.
RMVFeatureDetector::DetectorType initializationDetectorType() const
Returns the detector type for the initialization features.
Definition RMVFeatureMap.h:363
void setInitializationFeatures(Vectors3 &&objectPoints, const SharedAnyCamera &initializationCamera, const RMVFeatureDetector::DetectorType initializationDetectorType)
Sets or replaces the initialization features for this feature map by a given set of 3D features point...
static Box2 projectToImage(const AnyCamera &camera, const HomogenousMatrix4 &world_T_camera, const Box3 &objectBoundingBox)
Projects a 3D bounding box into the image plane of a given camera.
Indices32 mapRecentSemiStrongObjectPointIndices_
Indices of the semi-strongest object points from the most recently tracking iteration.
Definition RMVFeatureMap.h:231
RMVFeatureMap()
Creates an empty feature map.
const Vectors3 & objectPoints() const
Returns the object positions of the registered map features.
Definition RMVFeatureMap.h:255
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition Base.h:96
uint32_t Index32
Definition of a 32 bit index value.
Definition Base.h:84
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:61
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition Vector3.h:65
The namespace covering the entire Ocean framework.
Definition Accessor.h:15