Ocean
Ocean::Tracking::Database Class Reference

This class implements a database for 3D object points, 2D image points and 6DOF camera poses. More...

Data Structures

class  ConstImagePointAccessorIds
 This class implements an accessor object for image points based on a set of image point ids. More...
 
class  ConstImagePointAccessorTopology
 This class implements an accessor object for image points based on a topology between poses and image points. More...
 
class  ConstObjectPointAccessorIds
 This class implements an accessor object for object points based on a set of object point ids. More...
 
class  ConstPoseAccessorIds
 This class implements an accessor object for poses based on a set of pose ids. More...
 
class  ConstPoseAccessorTopology
 This class implements an accessor object for poses based on a topology between poses and image points. More...
 
class  Data
 The base class for all data object storing a set of image point ids. More...
 
class  ImagePointData
 This class implements a data object storing the information connected with an id of an image point. More...
 
class  ImagePointObject
 This class implements an object storing an id of an image point. More...
 
class  ObjectPointData
 The data object encapsulating a 3D object point. More...
 
class  ObjectPointObject
 This class implements an object storing an id of an object point. More...
 
class  PoseData
 The data object encapsulating a 6DOF camera pose. More...
 
class  PoseImagePointPair
 This class stores a pair of pose id and image point id. More...
 
class  PoseObject
 This class implements an object storing an id of an pose object. More...
 
class  TopologyTriple
 This class defines the topology between a camera pose id, an object point id and an image point id. More...
 

Public Types

typedef std::map< Index32, Vector2IdPointMap
 Definition of a map mapping ids to 2D image point object. More...
 
typedef std::pair< Index32, Vector2IdPointPair
 Definition of a pair of ids and 2D image points. More...
 
typedef std::vector< IdPointPairIdPointPairs
 Definition of a vector holding pairs of ids and 2D image points. More...
 
typedef std::map< Index32, IdPointPairsIdIdPointPairsMap
 Definition of a map mapping ids to 2D image point id pairs. More...
 
typedef std::map< Index32, Vectors2ImagePointsMap
 Definition of a map mapping ids to 2D vectors. More...
 
typedef std::vector< Vectors2ImagePointGroups
 Definition of a vector holding 2D vectors. More...
 
typedef std::vector< PoseImagePointPairPoseImagePointTopology
 Definition of a vector holding several pairs of pose and image point ids. More...
 
typedef std::vector< std::pair< Index32, PoseImagePointTopology > > PoseImagePointTopologyGroups
 Definition of a vector holding several groups of pairs of pose and image point ids. More...
 
typedef std::vector< TopologyTripleTopologyTriples
 Definition of a vector holding object of topology triple. More...
 

Public Member Functions

 Database ()
 Creates a new empty database object. More...
 
 Database (const Database &database)
 Copy constructor. More...
 
 Database (Database &&database) noexcept
 Move constructor. More...
 
Locklock ()
 Returns a reference to the lock object of this database object. More...
 
template<bool tThreadSafe>
bool isEmpty () const
 Returns whether this database holds at least one image point, one object point or one camera pose. More...
 
template<bool tThreadSafe>
size_t poseNumber () const
 Returns the number of poses of this database. More...
 
template<bool tThreadSafe>
size_t objectPointNumber () const
 Returns the number of object point ids in this database. More...
 
template<bool tThreadSafe>
size_t imagePointNumber () const
 Returns the number of image point ids in this database. More...
 
template<bool tThreadSafe>
const Vector2imagePoint (const Index32 imagePointId) const
 Returns the location of an image point which is specified by the id of the image point. More...
 
template<bool tThreadSafe>
Vectors2 imagePoints (const Indices32 &imagePointIds) const
 Returns the positions of 2D image points specified by the ids of the image points. More...
 
template<bool tThreadSafe>
Vectors2 imagePoints (const IndexSet32 &imagePointIds) const
 Returns the positions of 2D image points specified by the ids of the image points. More...
 
template<bool tThreadSafe>
bool hasObservation (const Index32 poseId, const Index32 objectPointId, Vector2 *point=nullptr, Index32 *pointId=nullptr) const
 Returns whether an object point is visible in a specified frame, and optional the location and id of the corresponding image point. More...
 
template<bool tThreadSafe>
const Vector3objectPoint (const Index32 objectPointId) const
 Returns the location of an object point which is specified by the id of the object point. More...
 
template<bool tThreadSafe>
const Vector3objectPoint (const Index32 objectPointId, Scalar &objectPointPriority) const
 Returns the location and priority of an object point which is specified by the id of the object point. More...
 
template<bool tThreadSafe>
Scalar objectPointPriority (const Index32 objectPointId) const
 Returns the priority of an object point which is specified by the id of the object point. More...
 
template<bool tThreadSafe>
Vectors3 objectPoints () const
 Returns the positions of all 3D object points. More...
 
template<bool tThreadSafe, bool tMatchPosition>
Vectors3 objectPoints (const Vector3 &referencePosition, Indices32 *objectPointIds=nullptr, const Scalar minimalPriority=Scalar(-1)) const
 Returns the positions of all 3D object points that match or that do not match the position of a specified reference object point and which have a specified minimal priority value. More...
 
template<bool tThreadSafe>
Vectors3 objectPoints (const Indices32 &objectPointIds) const
 Returns the positions of 3D object points specified by the ids of the object points. More...
 
template<bool tThreadSafe>
const HomogenousMatrix4pose (const Index32 poseId) const
 Returns the 6DOF pose of a camera frame which is specified by the id of the pose. More...
 
template<bool tThreadSafe>
HomogenousMatrices4 poses (const Index32 *poseIds, const size_t size) const
 Returns the 6DOF pose values for all specified pose ids. More...
 
template<bool tThreadSafe>
SquareMatrices3 rotationalPoses (const Index32 *poseIds, const size_t size) const
 Returns the 3DOF rotational part of the 6DOF pose values for all specified pose ids. More...
 
template<bool tThreadSafe, bool tMatchPose>
HomogenousMatrices4 poses (const HomogenousMatrix4 &referencePose, Indices32 *poseIds=nullptr) const
 Returns all 6DOF poses which match a given reference pose or which do not match a given reference pose. More...
 
template<bool tThreadSafe>
HomogenousMatrices4 poses (const Index32 lowerPoseId, const Index32 upperPoseId) const
 Returns all 6DOF poses (valid or invalid) lying between a specified range of pose ids. More...
 
template<bool tThreadSafe, bool tMatchPose>
Indices32 poseIds (const HomogenousMatrix4 &referencePose, HomogenousMatrices4 *poses=nullptr) const
 Returns the ids of specific 6DOF poses. More...
 
template<bool tThreadSafe>
bool poseBorders (Index32 &lowerPoseId, Index32 &upperPoseId) const
 Returns the smallest id (the id of the lower frame border) and the largest id (the id of the upper frame border) of all poses that are known in this database. More...
 
template<bool tThreadSafe>
bool validPoseBorders (Index32 &rangeLowerPoseId, Index32 &rangeUpperPoseId) const
 Returns the smallest id (the id of the lower frame border) and the largest id (the id of the upper frame border) with a valid pose (from all known poses in this database. More...
 
template<bool tThreadSafe>
bool validPoseRange (const Index32 lowerPoseId, const Index32 startPoseId, const Index32 upperPoseId, Index32 &rangeLowerPoseId, Index32 &rangeUpperPoseId) const
 Determines the pose id range (around a specified start frame) for which the database holds valid poses. More...
 
template<bool tThreadSafe>
bool largestValidPoseRange (const Index32 lowerPoseId, const Index32 upperPoseId, Index32 &rangeLowerPoseId, Index32 &rangeUpperPoseId) const
 Determines the largest pose id range for which the database holds valid poses. More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
bool poseWithMostCorrespondences (const Index32 lowerPoseId, const Index32 upperPoseId, Index32 *poseId=nullptr, unsigned int *correspondences=nullptr, const Vector3 &referenceObjectPoint=invalidObjectPoint()) const
 Determines the pose id for which the database holds the most number of point correspondences (between e.g., valid or invalid object points and image points). More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
bool poseWithLeastCorrespondences (const Index32 lowerPoseId, const Index32 upperPoseId, Index32 *poseId=nullptr, unsigned int *correspondences=nullptr, const Vector3 &referenceObjectPoint=invalidObjectPoint()) const
 Determines the pose id for which the database holds the least number of point correspondences (between e.g., valid or invalid object points and image points). More...
 
template<bool tThreadSafe>
bool poseWithMostObservations (const IndexSet32 &poseCandidates, const IndexSet32 &majorObjectPointIds, const IndexSet32 &minorObjectPointIds, Index32 &poseId, Indices32 *visibleMajorObjectPointIds=nullptr, Indices32 *visibleMinorObjectPointIds=nullptr) const
 Determines the pose id from a set of given pose id candidates for which the database holds the most observations from a set of given object point ids. More...
 
template<bool tThreadSafe>
unsigned int numberObservations (const Index32 poseId, const Indices32 &objectPointIds) const
 Counts the number of observations of a given set of object point ids for a specific camera frame. More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
unsigned int numberCorrespondences (const Index32 poseId, const Vector3 &referenceObjectPoint, const Scalar minimalPriority=Scalar(-1)) const
 Counts the number of correspondences (e.g., valid or invalid) between image and object points for a specified pose. More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
Indices32 numberCorrespondences (const Index32 lowerPoseId, const Index32 upperPoseId, const Vector3 &referenceObjectPoint, const Scalar minimalPriority=Scalar(-1), Worker *worker=nullptr) const
 Counts the number of valid correspondences between image and object points for several poses individually. More...
 
template<bool tThreadSafe>
bool hasImagePoint (const Index32 imagePointId, Vector2 *imagePoint=nullptr) const
 Returns whether this database holds a specified image point. More...
 
template<bool tThreadSafe>
Index32 addImagePoint (const Vector2 &imagePoint)
 Adds a new 2D image point to this database. More...
 
template<bool tThreadSafe>
void removeImagePoint (const Index32 imagePointId)
 Removes an image point from this database. More...
 
template<bool tThreadSafe>
bool hasObjectPoint (const Index32 objectPointId, Vector3 *objectPoint=nullptr) const
 Returns whether this database holds a specified object point. More...
 
template<bool tThreadSafe>
Index32 addObjectPoint (const Vector3 &objectPoint, const Scalar priority=Scalar(-1))
 Adds a new 3D object point to this database. More...
 
template<bool tThreadSafe>
void addObjectPoint (const Index32 objectPointId, const Vector3 &objectPoint, const Scalar priority=Scalar(-1))
 Adds a new 3D object point to this database. More...
 
Index32 addObjectPointFromDatabase (const Database &secondDatabase, const Index32 secondDatabaseObjectPointId, const SquareMatrix3 &imagePointTransformation=SquareMatrix3(true), const Index32 newObjectPointId=invalidId, const Index32 secondDatabaseLowerPoseId=invalidId, const Index32 secondDatabaseUpperPoseId=invalidId, const bool forExistingPosesOnly=false)
 Adds an object point from another database, adds all connected image points, registers unknown poses, and adds the topology. More...
 
template<bool tThreadSafe>
void removeObjectPoint (const Index32 objectPointId)
 Removes an object point from this database. More...
 
template<bool tThreadSafe>
void removeObjectPointAndAttachedImagePoints (const Index32 objectPointId)
 Removes an object point from this database and also removes all image points attached to the object point. More...
 
template<bool tThreadSafe>
void renameObjectPoint (const Index32 oldObjectPointId, const Index32 newObjectPointId)
 Renames an object point, changes the id of the object point respectively. More...
 
template<bool tThreadSafe>
void mergeObjectPoints (const Index32 remainingObjectPointId, const Index32 removingObjectPointId, const Vector3 &newPoint, const Scalar newPriority)
 Merges two object points together, afterwards one object point will be removed. More...
 
template<bool tThreadSafe>
bool hasPose (const Index32 poseId, HomogenousMatrix4 *pose=nullptr) const
 Returns whether this database holds a specified camera pose. More...
 
template<bool tThreadSafe>
bool addPose (const Index32 poseId, const HomogenousMatrix4 &pose=HomogenousMatrix4(false))
 Adds a new camera pose by specifying the unique id of the new pose. More...
 
template<bool tThreadSafe>
void removePose (const Index32 poseId)
 Removes a pose from this database. More...
 
template<bool tThreadSafe>
Index32 poseFromImagePoint (const Index32 imagePointId) const
 Determines the camera pose (camera frame) in which a specified image point is visible (to which the image point has been added). More...
 
template<bool tThreadSafe>
size_t numberImagePointsFromObjectPoint (const Index32 objectPointId) const
 Returns the number of image point observations which belong to a given object point. More...
 
template<bool tThreadSafe>
void observationsFromObjectPoint (const Index32 objectPointId, Indices32 &poseIds, Indices32 &imagePointIds, Vectors2 *imagePoints=nullptr) const
 Returns all observations (combination of poses and image points) which belong to a given object point. More...
 
template<bool tThreadSafe>
void observationsFromObjectPoint (const Index32 objectPointId, const Indices32 &poseIdCandidates, Indices32 &validPoseIndices, Indices32 *imagePointIds, Vectors2 *imagePoints=nullptr) const
 Returns all observations (combination of poses and image points) which belong to a given object point and a set of pose candidates. More...
 
template<bool tThreadSafe>
Index32 objectPointFromImagePoint (const Index32 imagePointId) const
 Returns the object point which belongs to a given image point. More...
 
template<bool tThreadSafe>
const IndexSet32imagePointsFromPose (const Index32 poseId) const
 Returns all image points which belong to a given camera pose. More...
 
template<bool tThreadSafe>
const IndexSet32imagePointsFromObjectPoint (const Index32 objectPointId) const
 Returns all image points which belong to a given object point. More...
 
template<bool tThreadSafe>
IndexSet32 posesFromObjectPoint (const Index32 objectPointId) const
 Returns all poses which belong to a given object point. More...
 
template<bool tThreadSafe>
void attachImagePointToObjectPoint (const Index32 imagePointId, const Index32 objectPointId)
 Attaches an existing image point to an existing object points (defines the topology between an image point and an object point). More...
 
template<bool tThreadSafe>
void detachImagePointFromObjectPoint (const Index32 imagePointId)
 Detaches an image point from an object point (withdraws the topology). More...
 
template<bool tThreadSafe>
void attachImagePointToPose (const Index32 imagePointId, const Index32 poseId)
 Attaches an existing image point to an existing camera pose (defines the topology between an image point and a camera pose). More...
 
template<bool tThreadSafe>
void detachImagePointFromPose (const Index32 imagePointId)
 Detaches an image point from a camera pose (withdraws the topology). More...
 
template<bool tThreadSafe>
void setImagePoint (const Index32 imagePointId, const Vector2 &imagePoint)
 Sets (changes) an image point. More...
 
template<bool tThreadSafe>
void setObjectPoint (const Index32 objectPointId, const Vector3 &objectPoint)
 Sets (changes) an object point without modifying the priority value of the object point. More...
 
template<bool tThreadSafe>
void setObjectPoints (const Index32 *objectPointIds, const Vector3 *objectPoints, const size_t number)
 Sets (changes) a set of object points without modifying the priority value of the object points. More...
 
template<bool tThreadSafe>
void setObjectPoints (const Index32 *objectPointIds, const size_t number, const Vector3 &referenceObjectPoint)
 Sets (changes) a set of object points without modifying the priority value of the object points. More...
 
template<bool tThreadSafe>
void setObjectPoints (const Vector3 &objectPoint=invalidObjectPoint())
 Sets (changes) all object points to one unique position without modifying the priority value of the object points. More...
 
template<bool tThreadSafe>
void setObjectPoint (const Index32 objectPointId, const Vector3 &objectPoint, const Scalar priority)
 Sets (changes) an object point. More...
 
template<bool tThreadSafe>
void setObjectPointPriority (const Index32 objectPointId, const Scalar priority)
 Sets (changes) the priority value of an object point. More...
 
template<bool tThreadSafe>
void setPose (const Index32 poseId, const HomogenousMatrix4 &pose)
 Sets (changes) a pose. More...
 
template<bool tThreadSafe>
void setPoses (const Index32 *poseIds, const HomogenousMatrix4 *poses, const size_t number)
 Sets (changes) a set of poses. More...
 
template<bool tThreadSafe>
void setPoses (const ShiftVector< HomogenousMatrix4 > &poses)
 Sets (changes) a set of poses. More...
 
template<bool tThreadSafe>
void setPoses (const HomogenousMatrix4 &pose)
 Sets (changes) all poses to one unique pose value. More...
 
template<bool tThreadSafe>
const IndexSet32imagePointIds (const Index32 poseId) const
 Returns the ids of all image points visible in a specified camera pose (camera frame). More...
 
template<bool tThreadSafe>
Indices32 imagePointIds (const Index32 poseId, Indices32 &objectPointIds) const
 Returns the ids of all image points which are projections of a set of object point in a specific camera frame. More...
 
template<bool tThreadSafe>
Vectors2 imagePoints (const Index32 poseId, Indices32 *imagePointIds=nullptr) const
 Returns all image points which are located in a specified frame. More...
 
template<bool tThreadSafe>
Indices32 imagePointIds (Vectors2 *imagePoints=nullptr) const
 Returns the ids of all image points that are part of this database. More...
 
template<bool tThreadSafe>
Indices32 objectPointIds (Vectors3 *objectPoints=nullptr, Scalars *priorities=nullptr) const
 Returns the ids of all object points that are part of this database. More...
 
template<bool tThreadSafe>
Indices32 objectPointIds (const IndexSet32 &outlierObjectPointIds) const
 Returns the ids of all object points that are part of this database and which are not provided by the explicit set of outlier object point ids. More...
 
template<bool tThreadSafe>
Indices32 poseIds (HomogenousMatrices4 *world_T_cameras=nullptr) const
 Returns the ids of all poses that are part of this database. More...
 
template<bool tThreadSafe, bool tMatchPosition>
Indices32 objectPointIds (const Vector3 &referencePosition, Vectors3 *objectPoints=nullptr, const Scalar minimalPriority=Scalar(-1)) const
 Returns all object points with a specific location and priority value larger or equal to a given threshold. More...
 
template<bool tThreadSafe, bool tMatchPosition>
Indices32 objectPointIds (const IndexSet32 &outlierObjectPointIds, const Vector3 &referencePosition, Vectors3 *objectPoints=nullptr, const Scalar minimalPriority=Scalar(-1)) const
 Returns the ids of all object points with a specific location and having a priority value larger or equal to a given threshold as long as the object point is not defined in the explicit set of outlier object point ids. More...
 
template<bool tThreadSafe, bool tMatchPosition>
IndexPairs32 objectPointIdsWithNumberOfObservations (const Vector3 &referencePosition, const Scalar minimalPriority=Scalar(-1), Worker *worker=nullptr) const
 Returns pairs of object point ids combined with counts of valid observations. More...
 
template<bool tThreadSafe>
Indices32 objectPointIds (const Index32 poseId, Vectors3 *objectPoints=nullptr) const
 Returns all ids of object points which are visible in a specified frame. More...
 
template<bool tThreadSafe, bool tMatchPosition>
Indices32 objectPointIds (const Index32 poseId, const Vector3 &referencePosition, const Scalar minimalPriority=Scalar(-1), Vectors3 *objectPoints=nullptr) const
 Returns all ids of object points which are visible in a specified frame and which match or do not match a specified reference position. More...
 
template<bool tThreadSafe>
Indices32 objectPointIds (const Indices32 poseIds, Vectors3 *objectPoints=nullptr) const
 Returns all ids of object points which are visible in several specified frames. More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tVisibleInAllPoses>
Indices32 objectPointIds (const Index32 lowerPoseId, const Index32 upperPoseId, const Vector3 &referencePosition=invalidObjectPoint(), const Scalar minimalPriority=Scalar(-1), Vectors3 *objectPoints=nullptr) const
 Returns all ids of object points which are visible in a specified frame range. More...
 
template<bool tThreadSafe, bool tMatchPosition, bool tVisibleInAllPoses>
Indices32 objectPointIds (const Indices32 &poseIds, const Vector3 &referencePosition=invalidObjectPoint(), const Scalar minimalPriority=Scalar(-1), Vectors3 *objectPoints=nullptr) const
 Returns all ids of object points which are visible in specified keyframes. More...
 
template<bool tThreadSafe>
Vectors2 imagePointsWithObjectPoints (const Index32 poseId, Indices32 &objectPointIds) const
 Returns all image points which are located in a specified frame and are projections of object points. More...
 
template<bool tThreadSafe>
Vectors2 imagePointsFromObjectPoints (const Index32 poseId, Indices32 &objectPointIds, Indices32 *imagePointIds=nullptr) const
 Returns all image points which are located in a specified frame and which are projections of a set of given object points. More...
 
template<bool tThreadSafe>
Vectors2 imagePointsFromObjectPoints (const Index32 poseId, const Indices32 &objectPointIds, Indices32 &validIndices, Indices32 *imagePointIds=nullptr) const
 Returns all image points which are located in a specified frame and which are projections of a set of given object points. More...
 
template<bool tThreadSafe>
Vectors2 imagePointsFromObjectPoints (const Index32 poseId, const Index32 *objectPointIds, const size_t numberObjectPointIds, Indices32 &validIndices, Indices32 *imagePointIds=nullptr) const
 Returns all image points which are located in a specified frame and which are projections of a set of given object points. More...
 
template<bool tThreadSafe>
ImagePointGroups imagePointGroups (const Indices32 poseIds, Indices32 &objectPointIds) const
 Determines the groups of image points matching to unique object points in individual camera poses. More...
 
template<bool tThreadSafe>
IdIdPointPairsMap imagePoints (const Index32 poseId, const bool previous, const size_t minimalObservations=2, const size_t maximalObservations=0) const
 Returns object points with corresponding image points entirely visible in a specific range of camera poses. More...
 
template<bool tThreadSafe>
void imagePoints (const Index32 pose0, const Index32 pose1, Vectors2 &points0, Vectors2 &points1, Indices32 *objectPointIds=nullptr) const
 Determines the image points which are projections from the same object points and are visible in two individual camera poses. More...
 
template<bool tThreadSafe, bool tMatchPosition>
void imagePointsObjectPoints (const Index32 poseId, Vectors2 &imagePoints, Vectors3 &objectPoints, const Vector3 &referencePosition=invalidObjectPoint(), const size_t minimalObservations=0, Indices32 *imagePointIds=nullptr, Indices32 *objectPointIds=nullptr) const
 Returns corresponding object points and image points for a given camera pose. More...
 
template<bool tThreadSafe, bool tMatchPosition>
void imagePointsObjectPoints (const Index32 poseId, const IndexSet32 &priorityIds, Vectors2 &priorityImagePoints, Vectors3 &priorityObjectPoints, Vectors2 &remainingImagePoints, Vectors3 &remainingObjectPoints, const Vector3 &referencePosition=invalidObjectPoint(), const size_t minimalObservations=0, Indices32 *priorityImagePointIds=nullptr, Indices32 *priorityObjectPointIds=nullptr, Indices32 *remainingImagePointIds=nullptr, Indices32 *remainingObjectPointIds=nullptr) const
 Returns two groups of corresponding object points and image points for a given camera pose. More...
 
template<bool tThreadSafe, bool tMatchPose>
void posesImagePoints (const Index32 objectPointId, HomogenousMatrices4 &poses, Vectors2 &imagePoints, const HomogenousMatrix4 &referencePose=HomogenousMatrix4(false), Indices32 *poseIds=nullptr, Indices32 *imagePointIds=nullptr, const Index32 lowerPoseId=invalidId, const Index32 upperPoseId=invalidId) const
 Returns corresponding poses and image points for a given object point from the entire range of possible camera poses. More...
 
template<bool tThreadSafe>
TopologyTriples topologyTriples (const Indices32 &poseIds) const
 Returns topology triples with valid image points ids, object points ids and pose ids for a set of given pose ids. More...
 
template<bool tThreadSafe>
void clear ()
 Clears the database including all camera poses, object points, image points and any topology. More...
 
template<bool tThreadSafe>
void reset (const Vector3 &referenceObjectPoint=invalidObjectPoint(), const HomogenousMatrix4 &referencePose=HomogenousMatrix4(false))
 Resets the geometric information of this database for 3D object points and 6DOF camera poses. More...
 
template<typename T , bool tThreadSafe>
void reset (const size_t numberPoses, const Index32 *poseIds, const HomogenousMatrixT4< T > *poses, const size_t numberObjectPoints, const Index32 *objectPointIds, const VectorT3< T > *objectPoints, const T *objectPointPriorities, const size_t numberImagePoints, const Index32 *imagePointIds, const VectorT2< T > *imagePoints, const Index32 *topologyPoseIds, const Index32 *topologyObjectPointIds)
 Resets this database with given poses, object points, image points, and topology. More...
 
Databaseoperator= (const Database &database)
 Assign operator copying a second database to this database object. More...
 
Databaseoperator= (Database &&database) noexcept
 Move operator moving a second database to this database object. More...
 
 operator bool () const
 Returns whether this database holds at least one image point, one object point or one camera pose. More...
 

Static Public Member Functions

static Vector3 invalidObjectPoint ()
 Returns an invalid object point. More...
 
static Indices32 filterTopologyTriplesPoses (const TopologyTriples &topologyTriples, const IndexSet32 &poseIds)
 Filters a set of given topology triples due to a set of given pose ids. More...
 
static Indices32 filterTopologyTriplesObjectPoints (const TopologyTriples &topologyTriples, const IndexSet32 &objectPointIds)
 Filters a set of given topology triples due to a set of given object point ids. More...
 
static Indices32 filterTopologyTriplesImagePoints (const TopologyTriples &topologyTriples, const IndexSet32 &imagePointIds)
 Filters a set of given topology triples due to a set of given image point ids. More...
 
static Indices32 reliableObjectPoints (const TopologyTriples &topologyTriples, const unsigned int minimalObservations)
 Determines reliable object points from a set of given topology triples (by determining all object points with a minimal number of observations). More...
 
static PoseImagePointTopologyGroups objectPointTopology (const TopologyTriples &topologyTriples, const Indices32 *indices=nullptr)
 Converts the set of topology triples into a representation which is forced/oriented by object points so that the camera poses and image points can be accessed for a specific object points. More...
 

Static Public Attributes

static const Index32 invalidId = Index32(-1)
 Definition of an invalid id. More...
 

Protected Types

typedef std::map< Index32, PoseDataPoseMap
 Definition of an (ordered) map mapping pose ids to pose data objects, we use an ordered map as poses have an order. More...
 
typedef std::unordered_map< Index32, ObjectPointDataObjectPointMap
 Definition of an (unordered) map mapping object point ids to object point data objects. More...
 
typedef std::unordered_map< Index32, ImagePointDataImagePointMap
 Definition of an (unordered) map mapping image point ids to image point data objects. More...
 
typedef std::unordered_map< Index32, Index32Index32To32Map
 Definition of an (unordered) map mapping 32 bit ids to 32 bit ids. More...
 
typedef std::unordered_map< Index64, Index32Index64To32Map
 Definition of an (unordered) map mapping 64 bit ids to 32 bit ids. More...
 

Protected Member Functions

template<bool tMatchPosition, bool tNeedValidPose>
void numberCorrespondencesSubset (const Index32 lowerPoseId, const Vector3 *referenceObjectPoint, const Scalar minimalPriority, unsigned int *correspondences, const unsigned int firstPose, const unsigned int numberPoses) const
 Counts the number of valid correspondences between image and object points for a subset of several poses individually. More...
 
template<bool tMatchPosition>
void objectPointIdsWithNumberOfObservationsSubset (const Index32 *objectPointIds, const Vector3 *referencePosition, const Scalar minimalPriority, IndexPairs32 *pairs, Lock *lock, const unsigned int firstObjectPoint, const unsigned int numberObjectPoints) const
 Returns pairs of object point ids combined with counts of valid observations. More...
 
unsigned int numberValidPoses (const Index32 objectPointId, const IndexSet32 &imagePointIds) const
 Counts the number of valid poses of a given object point. More...
 

Static Protected Member Functions

static Index32 firstIndex (const Index64 index)
 Returns the first 32 bit index of a 64 bit index. More...
 
static Index32 secondIndex (const Index64 index)
 Returns the second 32 bit index of a 64 bit index. More...
 
static Index64 index64 (const Index32 first, const Index32 second)
 Returns the 64 bit index composed of two 32 bit indices. More...
 

Protected Attributes

PoseMap databasePoseMap
 The map mapping unique pose ids to pose data instances. More...
 
ObjectPointMap databaseObjectPointMap
 The map mapping unique object point ids to object point data instances. More...
 
ImagePointMap databaseImagePointMap
 The map mapping unique image points ids to image point data instances. More...
 
Index64To32Map databasePoseObjectPointMap
 The map mapping a pair of pose id and object point id to image point ids. More...
 
unsigned int databasePoses
 The number of poses. More...
 
Index32 databaseObjectPointIdCounter
 The counter for unique object point ids. More...
 
Index32 databaseImagePointIdCounter
 The counter for unique image point ids. More...
 
Lock databaseLock
 The lock for the entire database. More...
 

Detailed Description

This class implements a database for 3D object points, 2D image points and 6DOF camera poses.

Any 2D image point is located in a camera frame, while any camera frame has an own camera pose.
Corresponding image points in consecutive camera frames can belong to the same 3D object point.
This database stores ids for image points, object points, priority values of object points, camera poses and field of views of camera poses.
Further, the topology between the individual database elements can be defined.
The locations of the image points (2D positions within the camera frames) must be valid always.
The locations of the object points or the transformation values of the camera poses may be invalid as in this case the location of the transformation has not been determined yet.

An id of an image point has the following connections:

image point id  ->  2D point location (always valid)
                ->  camera pose id (the id of the camera pose in which frame the image point is located)
                ->  3D object point id (the id of the object point which projects to the image point)

Due to performance issues object points and camera poses store mappings to their corresponding image points.
An id of an object point has the following connections:

object point id  ->  3D point location (may be invalid)
                 ->  Priority value
                 ->  image point ids (the ids of all image points which are projections of the object points)

An id of a camera pose has the following connections:

camera pose id  ->  6DOF pose (may be invalid)
                ->  Field of View value
                ->  image point ids (the ids of all image points visible in the camera frame belonging to the camera pose)

Finally, the database stores a mapping between a pair of pose ids and object points ids and image points ids:

pose id, object point id  ->  image point id

The internal data structure of this database allows arbitrary element access with almost O(log n).
Due to the performance issue connections between the individual objects are necessary.

Member Typedef Documentation

◆ IdIdPointPairsMap

Definition of a map mapping ids to 2D image point id pairs.

◆ IdPointMap

Definition of a map mapping ids to 2D image point object.

◆ IdPointPair

Definition of a pair of ids and 2D image points.

◆ IdPointPairs

Definition of a vector holding pairs of ids and 2D image points.

◆ ImagePointGroups

Definition of a vector holding 2D vectors.

◆ ImagePointMap

typedef std::unordered_map<Index32, ImagePointData> Ocean::Tracking::Database::ImagePointMap
protected

Definition of an (unordered) map mapping image point ids to image point data objects.

◆ ImagePointsMap

Definition of a map mapping ids to 2D vectors.

◆ Index32To32Map

typedef std::unordered_map<Index32, Index32> Ocean::Tracking::Database::Index32To32Map
protected

Definition of an (unordered) map mapping 32 bit ids to 32 bit ids.

◆ Index64To32Map

typedef std::unordered_map<Index64, Index32> Ocean::Tracking::Database::Index64To32Map
protected

Definition of an (unordered) map mapping 64 bit ids to 32 bit ids.

◆ ObjectPointMap

typedef std::unordered_map<Index32, ObjectPointData> Ocean::Tracking::Database::ObjectPointMap
protected

Definition of an (unordered) map mapping object point ids to object point data objects.

◆ PoseImagePointTopology

Definition of a vector holding several pairs of pose and image point ids.

◆ PoseImagePointTopologyGroups

Definition of a vector holding several groups of pairs of pose and image point ids.

◆ PoseMap

typedef std::map<Index32, PoseData> Ocean::Tracking::Database::PoseMap
protected

Definition of an (ordered) map mapping pose ids to pose data objects, we use an ordered map as poses have an order.

◆ TopologyTriples

Definition of a vector holding object of topology triple.

Constructor & Destructor Documentation

◆ Database() [1/3]

Ocean::Tracking::Database::Database ( )
inline

Creates a new empty database object.

◆ Database() [2/3]

Ocean::Tracking::Database::Database ( const Database database)
inline

Copy constructor.

Parameters
databaseThe database object to be copied

◆ Database() [3/3]

Ocean::Tracking::Database::Database ( Database &&  database)
inlinenoexcept

Move constructor.

Parameters
databaseThe database object to be moved

Member Function Documentation

◆ addImagePoint()

template<bool tThreadSafe>
Index32 Ocean::Tracking::Database::addImagePoint ( const Vector2 imagePoint)
inline

Adds a new 2D image point to this database.

Parameters
imagePointThe image point to be added
Returns
The unique id of the new image point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ addObjectPoint() [1/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::addObjectPoint ( const Index32  objectPointId,
const Vector3 objectPoint,
const Scalar  priority = Scalar(-1) 
)
inline

Adds a new 3D object point to this database.

This function does not use the internal id counter for object points to create a new id.
Instead, this function takes an explicit object point id.
Beware: Do not mix calls with the add-objectPoint-function creating the id on its own.

Parameters
objectPointIdThe unique id of the new object point, must not exist already
objectPointThe object point to be added
priorityThe priority value of the object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
hasObjectPoint().

◆ addObjectPoint() [2/2]

template<bool tThreadSafe>
Index32 Ocean::Tracking::Database::addObjectPoint ( const Vector3 objectPoint,
const Scalar  priority = Scalar(-1) 
)
inline

Adds a new 3D object point to this database.

This function uses the internal id counter for object points to create a new id.
Beware: Do not mix calls with the add-objectPoint-function not creating the id on its own.

Parameters
objectPointThe object point to be added
priorityThe priority value of the object point
Returns
The unique id of the new object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ addObjectPointFromDatabase()

Index32 Ocean::Tracking::Database::addObjectPointFromDatabase ( const Database secondDatabase,
const Index32  secondDatabaseObjectPointId,
const SquareMatrix3 imagePointTransformation = SquareMatrix3(true),
const Index32  newObjectPointId = invalidId,
const Index32  secondDatabaseLowerPoseId = invalidId,
const Index32  secondDatabaseUpperPoseId = invalidId,
const bool  forExistingPosesOnly = false 
)
inline

Adds an object point from another database, adds all connected image points, registers unknown poses, and adds the topology.

Thus, this function mainly merges a track from a second database to this database. Beware: This function is not thread-safe (as we need to prevent possible dead locks).

Parameters
secondDatabaseThe second database from which the track (the object point and all connected information) will be copied
secondDatabaseObjectPointIdThe id of the object point in the second database to be copied
imagePointTransformationA transformation which will be applied to each connected image point (from the second database) before the image point is added to this database, an identity transformation to keep the image points as they are, the transformation defines: thisDatabaseImagePoint = imagePointTransformation * secondDatabaseImagePoint, must not be singular
newObjectPointIdOptional explicit id of the new object point in this database, must not exist in this database if defined, an invalid id to generate a new id automatically
secondDatabaseLowerPoseIdOptional pose id defining the lower border of the pose range from which observations (image points) of the object point will be copied, an invalid id to copy all possible observations, with range [0, secondDatabaseUpperPoseId] or invalidId
secondDatabaseUpperPoseIdOptional pose id defining the upper border of the pose range from which observations (image points) of the object point will be copied, an invalid id to copy all possible observations, with range [secondDatabaseLowerPoseId, infinity) or invalidId
forExistingPosesOnlyTrue, to avoid the creation of new poses in this database (and to skip observations/image points); False, to create new poses in this database if not existing already
Returns
The id of the new object point in this database, an invalid id if the track could not be copied

◆ addPose()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::addPose ( const Index32  poseId,
const HomogenousMatrix4 pose = HomogenousMatrix4(false) 
)
inline

Adds a new camera pose by specifying the unique id of the new pose.

Beware: The given unique id must not exist in the database, define the pose id so that it matches to e.g., a unique frame index.

Parameters
poseIdThe unique id of the new pose, must be valid
poseThe pose to be set, may be invalid
Returns
True, if the given pose id does not exist in the database
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ attachImagePointToObjectPoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::attachImagePointToObjectPoint ( const Index32  imagePointId,
const Index32  objectPointId 
)
inline

Attaches an existing image point to an existing object points (defines the topology between an image point and an object point).

Parameters
imagePointIdThe id of the image point which will be attached to the specified object points, must be valid
objectPointIdThe id of the object points which will receive the connection to the given image point, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ attachImagePointToPose()

template<bool tThreadSafe>
void Ocean::Tracking::Database::attachImagePointToPose ( const Index32  imagePointId,
const Index32  poseId 
)
inline

Attaches an existing image point to an existing camera pose (defines the topology between an image point and a camera pose).

Parameters
imagePointIdThe id of the image point which will be attached to the specified object points, must be valid
poseIdThe id of the pose which will receive the connection to the given image point, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ clear()

template<bool tThreadSafe>
void Ocean::Tracking::Database::clear
inline

Clears the database including all camera poses, object points, image points and any topology.

Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ detachImagePointFromObjectPoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::detachImagePointFromObjectPoint ( const Index32  imagePointId)
inline

Detaches an image point from an object point (withdraws the topology).

Parameters
imagePointIdthe id of the image point from which the topology to the object point will be removed, must be valid

◆ detachImagePointFromPose()

template<bool tThreadSafe>
void Ocean::Tracking::Database::detachImagePointFromPose ( const Index32  imagePointId)
inline

Detaches an image point from a camera pose (withdraws the topology).

Parameters
imagePointIdthe id of the image point from which the topology to the camera pose will be removed, must be valid

◆ filterTopologyTriplesImagePoints()

Indices32 Ocean::Tracking::Database::filterTopologyTriplesImagePoints ( const TopologyTriples topologyTriples,
const IndexSet32 imagePointIds 
)
inlinestatic

Filters a set of given topology triples due to a set of given image point ids.

Parameters
topologyTriplesThe set of topology triplies which will be filtered
imagePointIdsThe ids of the image points defining which triples are returned (the indices respectively)
Returns
The indices of the topology triples which belong to one of the given image points

◆ filterTopologyTriplesObjectPoints()

Indices32 Ocean::Tracking::Database::filterTopologyTriplesObjectPoints ( const TopologyTriples topologyTriples,
const IndexSet32 objectPointIds 
)
inlinestatic

Filters a set of given topology triples due to a set of given object point ids.

Parameters
topologyTriplesThe set of topology triplies which will be filtered
objectPointIdsThe ids of the object points defining which triples are returned (the indices respectively)
Returns
The indices of the topology triples which belong to one of the given object points

◆ filterTopologyTriplesPoses()

Indices32 Ocean::Tracking::Database::filterTopologyTriplesPoses ( const TopologyTriples topologyTriples,
const IndexSet32 poseIds 
)
inlinestatic

Filters a set of given topology triples due to a set of given pose ids.

Parameters
topologyTriplesThe set of topology triplies which will be filtered
poseIdsThe ids of the camera pose defining which triples are returned (the indices respectively)
Returns
The indices of the topology triples which belong to one of the given camera poses

◆ firstIndex()

Index32 Ocean::Tracking::Database::firstIndex ( const Index64  index)
inlinestaticprotected

Returns the first 32 bit index of a 64 bit index.

Parameters
indexThe 64 bit index
Returns
First 32 bit index

◆ hasImagePoint()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::hasImagePoint ( const Index32  imagePointId,
Vector2 imagePoint = nullptr 
) const
inline

Returns whether this database holds a specified image point.

Parameters
imagePointIdThe unique id of the image point which will be checked
imagePointOptional resulting image point value of the defined image point id
Returns
True, if so
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ hasObjectPoint()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::hasObjectPoint ( const Index32  objectPointId,
Vector3 objectPoint = nullptr 
) const
inline

Returns whether this database holds a specified object point.

Parameters
objectPointIdThe unique id of the object point which will be checked
objectPointOptional resulting object point value of the defined object point id
Returns
True, if so
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ hasObservation()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::hasObservation ( const Index32  poseId,
const Index32  objectPointId,
Vector2 point = nullptr,
Index32 pointId = nullptr 
) const
inline

Returns whether an object point is visible in a specified frame, and optional the location and id of the corresponding image point.

Parameters
poseIdThe id of the camera pose for which the visibility of the object point is checked, must be valid
objectPointIdThe unique id of the object point, must be valid
pointOptional resulting location of the image point, if any
pointIdOptional resulting unique id of the image point, if any
Returns
True, if the defined object point has a visible image point in the specified camera pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ hasPose()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::hasPose ( const Index32  poseId,
HomogenousMatrix4 pose = nullptr 
) const
inline

Returns whether this database holds a specified camera pose.

Parameters
poseIdThe unique id of the pose which will be checked
poseOptional resulting pose value of the defined pose id
Returns
True, if so
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePoint()

template<bool tThreadSafe>
const Vector2 & Ocean::Tracking::Database::imagePoint ( const Index32  imagePointId) const
inline

Returns the location of an image point which is specified by the id of the image point.

Beware: The requested image point must exist in this database.

Parameters
imagePointIdThe unique id of the image point, must be valid
Returns
The location of the specified image point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointGroups()

template<bool tThreadSafe>
Database::ImagePointGroups Ocean::Tracking::Database::imagePointGroups ( const Indices32  poseIds,
Indices32 objectPointIds 
) const

Determines the groups of image points matching to unique object points in individual camera poses.

Image points within one group correspond to one object point while the order of the image points correspond with the order of the given camera poses.

Parameters
poseIdsThe ids of the camera pose in which the object points are visible which form the groups of image points.
objectPointIdsResulting ids of object points which are visible in all camera pose and to which the resulting groups of image points correspond
Returns
Resulting groups of image points one group for each resulting object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointIds() [1/3]

template<bool tThreadSafe>
const IndexSet32 & Ocean::Tracking::Database::imagePointIds ( const Index32  poseId) const

Returns the ids of all image points visible in a specified camera pose (camera frame).

Parameters
poseIdThe id of the camera pose in which the image points are visible, must be valid
Returns
The indices of all image points
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointIds() [2/3]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::imagePointIds ( const Index32  poseId,
Indices32 objectPointIds 
) const
inline

Returns the ids of all image points which are projections of a set of object point in a specific camera frame.

Parameters
poseIdThe id of the camera pose in which the image points will be located
objectPointIdsThe ids of the object points for which the image points are requested, this set will be modified so that the set finally contains only object points which have a connected image point (in the specified frame)
Returns
The resulting ids of the image points, one ids for each object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointIds() [3/3]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::imagePointIds ( Vectors2 imagePoints = nullptr) const

Returns the ids of all image points that are part of this database.

Parameters
imagePointsOptional resulting image points, one for each resulting image point id, nullptr if not of interest
Returns
The image point ids
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointNumber()

template<bool tThreadSafe>
size_t Ocean::Tracking::Database::imagePointNumber
inline

Returns the number of image point ids in this database.

Returns
The database's image point id number

◆ imagePoints() [1/5]

template<bool tThreadSafe>
void Ocean::Tracking::Database::imagePoints ( const Index32  pose0,
const Index32  pose1,
Vectors2 points0,
Vectors2 points1,
Indices32 objectPointIds = nullptr 
) const

Determines the image points which are projections from the same object points and are visible in two individual camera poses.

Parameters
pose0The id of the first camera pose, must be valid
pose1The id of the second camera pose, must be valid and must not be 'pose0'
points0The resulting image points visible in the first camera pose
points1The resulting image points visible in the second camera pose, each point corresponds to one point from 'points0'
objectPointIdsOptional resulting ids of the object points which are visible in both camera poses
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePoints() [2/5]

template<bool tThreadSafe>
Database::IdIdPointPairsMap Ocean::Tracking::Database::imagePoints ( const Index32  poseId,
const bool  previous,
const size_t  minimalObservations = 2,
const size_t  maximalObservations = 0 
) const

Returns object points with corresponding image points entirely visible in a specific range of camera poses.

Parameters
poseIdThe id of the camera pose which is the start position of the range of camera poses
previousTrue, if the range covers the previous camera poses; False, if the range covers the subsequent camera poses
minimalObservationsThe minimal number of successive camera poses in which an object point must be visible
maximalObservationsOptional the maximal number of successive camera poses (more poses will not be investigated), 0 or with range [minimalObservations, infinity)
Returns
The map mapping object points to image points
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePoints() [3/5]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePoints ( const Index32  poseId,
Indices32 imagePointIds = nullptr 
) const

Returns all image points which are located in a specified frame.

Parameters
poseIdThe id of the camera pose in which frame the image points are requested
imagePointIdsOptional resulting ids of the resulting image points one id for each point
Returns
All image points located in the specified frame
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePoints() [4/5]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePoints ( const IndexSet32 imagePointIds) const
inline

Returns the positions of 2D image points specified by the ids of the image points.

Parameters
imagePointIdsThe ids of the image points for which the positions will be returned, must be valid
Returns
The resulting image point positions, one position for each id
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePoints() [5/5]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePoints ( const Indices32 imagePointIds) const
inline

Returns the positions of 2D image points specified by the ids of the image points.

Parameters
imagePointIdsThe ids of the image points for which the positions will be returned, must be valid
Returns
The resulting image point positions, one position for each id
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointsFromObjectPoint()

template<bool tThreadSafe>
const IndexSet32 & Ocean::Tracking::Database::imagePointsFromObjectPoint ( const Index32  objectPointId) const
inline

Returns all image points which belong to a given object point.

Beware: The resulting reference is valid as long as the database is not modified.

Parameters
objectPointIdThe id of the object point for which the connected image points are requested, must be valid
Returns
The ids of all image points which are connected with the specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointsFromObjectPoints() [1/3]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePointsFromObjectPoints ( const Index32  poseId,
const Index32 objectPointIds,
const size_t  numberObjectPointIds,
Indices32 validIndices,
Indices32 imagePointIds = nullptr 
) const

Returns all image points which are located in a specified frame and which are projections of a set of given object points.

As not all object points may be visible in the specified frame, the number of resulting image points may be smaller than the number of specified object points.
The set of specified object points is untouched, however a resulting set of indices return the indices of valid object points (indices as specified in the set of object points).

Parameters
poseIdThe id of the camera pose in which frame the image points are requested
objectPointIdsThe ids of the object points for which the corresponding image points are requested
numberObjectPointIdsThe number of given object point ids
validIndicesThe indices of valid object points, !not! the ids of valid object points
imagePointIdsOptional resulting image point ids of the resulting image points
Returns
The image points which are visible projections of the specified object points, the number of image points is equal to the resulting set of indices of valid object points
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointsFromObjectPoints() [2/3]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePointsFromObjectPoints ( const Index32  poseId,
const Indices32 objectPointIds,
Indices32 validIndices,
Indices32 imagePointIds = nullptr 
) const

Returns all image points which are located in a specified frame and which are projections of a set of given object points.

As not all object points may be visible in the specified frame, the number of resulting image points may be smaller than the number of specified object points.
The set of specified object points is untouched, however a resulting set of indices return the indices of valid object points (indices as specified in the set of object points).

Parameters
poseIdThe id of the camera pose in which frame the image points are requested
objectPointIdsThe ids of the object points for which the corresponding image points are requested
validIndicesThe indices of valid object points, !not! the ids of valid object points
imagePointIdsOptional resulting image point ids of the resulting image points
Returns
The image points which are visible projections of the specified object points, the number of image points is equal to the resulting set of indices of valid object points
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointsFromObjectPoints() [3/3]

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePointsFromObjectPoints ( const Index32  poseId,
Indices32 objectPointIds,
Indices32 imagePointIds = nullptr 
) const

Returns all image points which are located in a specified frame and which are projections of a set of given object points.

As not all object points may be visible in the specified frame, the set of given object points will be modified so that set contains only visible object points after calling this function.

Parameters
poseIdThe id of the camera pose in which frame the image points are requested
objectPointIdsThe ids of the object points for which the corresponding image points are requested
imagePointIdsOptional resulting image point ids of the resulting image points
Returns
The resulting image points located in the specified frame
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
imagePointsWithObjectPoints().

◆ imagePointsFromPose()

template<bool tThreadSafe>
const IndexSet32 & Ocean::Tracking::Database::imagePointsFromPose ( const Index32  poseId) const
inline

Returns all image points which belong to a given camera pose.

Beware: The resulting reference is valid as long as the database is not modified.

Parameters
poseIdThe id of the camera pose for which the connected image points are requested, must be valid
Returns
The ids of all image points which are connected with the specified camera pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ imagePointsObjectPoints() [1/2]

template<bool tThreadSafe, bool tMatchPosition>
void Ocean::Tracking::Database::imagePointsObjectPoints ( const Index32  poseId,
const IndexSet32 priorityIds,
Vectors2 priorityImagePoints,
Vectors3 priorityObjectPoints,
Vectors2 remainingImagePoints,
Vectors3 remainingObjectPoints,
const Vector3 referencePosition = invalidObjectPoint(),
const size_t  minimalObservations = 0,
Indices32 priorityImagePointIds = nullptr,
Indices32 priorityObjectPointIds = nullptr,
Indices32 remainingImagePointIds = nullptr,
Indices32 remainingObjectPointIds = nullptr 
) const

Returns two groups of corresponding object points and image points for a given camera pose.

The first group of correspondences have object points from the given set of priority object points The second group of correspondences have object points not given in the set of priority object points

Parameters
poseIdThe id of the camera pose for which the object and image points are requested
priorityIdsThe ids of the object points which will belong to the group of priority correspondences
priorityImagePointsThe resulting image points located in the specified camera pose belonging to the priority group
priorityObjectPointsThe resulting object points belonging to the priority group, each point corresponds to one image points from 'imagePoints'
remainingImagePointsThe resulting image points located in the specified camera pose belonging to the remaining group
remainingObjectPointsThe resulting object points belonging to the remaining group, each point corresponds to one image points from 'imagePoints'
referencePositionThe 3D reference position which is used to filter the object points
minimalObservationsThe minimal number of observations a resulting object points must have (in arbitrary sibling camera pose)
priorityImagePointIdsOptional ids of the resulting image points belonging to the priority group
priorityObjectPointIdsOptional ids of the resulting object points belonging to the priority group
remainingImagePointIdsOptional ids of the resulting image points belonging to the remaining group
remainingObjectPointIdsOptional ids of the resulting object points belonging to the remaining group
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points

◆ imagePointsObjectPoints() [2/2]

template<bool tThreadSafe, bool tMatchPosition>
void Ocean::Tracking::Database::imagePointsObjectPoints ( const Index32  poseId,
Vectors2 imagePoints,
Vectors3 objectPoints,
const Vector3 referencePosition = invalidObjectPoint(),
const size_t  minimalObservations = 0,
Indices32 imagePointIds = nullptr,
Indices32 objectPointIds = nullptr 
) const

Returns corresponding object points and image points for a given camera pose.

Parameters
poseIdThe id of the camera pose for which the object and image points are requested
imagePointsThe resulting image points located in the specified camera pose
objectPointsThe resulting object points, each point corresponds to one image points from 'imagePoints'
referencePositionThe 3D reference position which is used to filter the object points
minimalObservationsThe minimal number of observations a resulting object points must have (in arbitrary sibling camera pose)
imagePointIdsOptional ids of the resulting image points
objectPointIdsOptional ids of the resulting object points
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points

◆ imagePointsWithObjectPoints()

template<bool tThreadSafe>
Vectors2 Ocean::Tracking::Database::imagePointsWithObjectPoints ( const Index32  poseId,
Indices32 objectPointIds 
) const

Returns all image points which are located in a specified frame and are projections of object points.

Parameters
poseIdThe id of the camera pose in which frame the image points are requested
objectPointIdsResulting object point ids corresponding to the individual image points
Returns
The resulting image points located in the specified frame and having a corresponding object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
imagePointsFromObjectPoints().

◆ index64()

Index64 Ocean::Tracking::Database::index64 ( const Index32  first,
const Index32  second 
)
inlinestaticprotected

Returns the 64 bit index composed of two 32 bit indices.

Parameters
firstThe first 32 bit index
secondThe second 32 bit index
Returns
The resulting 64 bit index

◆ invalidObjectPoint()

Vector3 Ocean::Tracking::Database::invalidObjectPoint ( )
inlinestatic

Returns an invalid object point.

Returns
Invalid object point

◆ isEmpty()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::isEmpty
inline

Returns whether this database holds at least one image point, one object point or one camera pose.

Returns
True, if so
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ largestValidPoseRange()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::largestValidPoseRange ( const Index32  lowerPoseId,
const Index32  upperPoseId,
Index32 rangeLowerPoseId,
Index32 rangeUpperPoseId 
) const
inline

Determines the largest pose id range for which the database holds valid poses.

Parameters
lowerPoseIdThe id of the frame defining the lower border of the camera poses which will be investigated, with range [0, infinity)
upperPoseIdThe id of the frame defining the upper border of the camera poses which will be investigated, with range [lowerPoseId, infinity)
rangeLowerPoseIdResulting id of the first camera pose/camera frame with valid camera pose, with range [lowerPoseId, upperPoseId]
rangeUpperPoseIdResulting id of the last camera pose/camera frame with valid camera pose, with range [rangeLowerPoseId, upperPoseId]
Returns
True, if the resulting range holds at least one valid pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
validPoseRange(), poseBorders().

◆ lock()

Lock & Ocean::Tracking::Database::lock ( )
inline

Returns a reference to the lock object of this database object.

Returns
The lock object's reference

◆ mergeObjectPoints()

template<bool tThreadSafe>
void Ocean::Tracking::Database::mergeObjectPoints ( const Index32  remainingObjectPointId,
const Index32  removingObjectPointId,
const Vector3 newPoint,
const Scalar  newPriority 
)
inline

Merges two object points together, afterwards one object point will be removed.

Both object points must not be visible in the same camera pose.

Parameters
remainingObjectPointIdThe id of the object point which will remain after merging both object points, must be valid
removingObjectPointIdThe id of the object point which will be removed after merging both object points, must be valid
newPointThe location of the merged object point
newPriorityThe priority of the merged object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ numberCorrespondences() [1/2]

template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
Indices32 Ocean::Tracking::Database::numberCorrespondences ( const Index32  lowerPoseId,
const Index32  upperPoseId,
const Vector3 referenceObjectPoint,
const Scalar  minimalPriority = Scalar(-1),
Worker worker = nullptr 
) const
inline

Counts the number of valid correspondences between image and object points for several poses individually.

Parameters
lowerPoseIdThe id (index) of the frame defining the lower border of camera poses which will be investigated
upperPoseIdThe id (index) of the frame defining the upper border of camera poses which will be investigated, with range [lowerFrame, infinity)
referenceObjectPointA reference object point allowing to filter the correspondences to count
minimalPriorityThe minimal priority value an object point must have so that is will be investigated
workerOptional worker to distribute the computation
Returns
The number of correspondences for each pose in the range [lowerPoseId, upperPoseId] starting with 'lowerPoseId' (the first entry corresponds to 'lowerPoseId' and so on)
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the correspondences; False, if the defined position will not match the positions of the correspondences
tNeedValidPoseTrue, if the pose must be valid so that the number of valid correspondences will be determined, otherwise the number of correspondences will be zero

◆ numberCorrespondences() [2/2]

template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
unsigned int Ocean::Tracking::Database::numberCorrespondences ( const Index32  poseId,
const Vector3 referenceObjectPoint,
const Scalar  minimalPriority = Scalar(-1) 
) const
inline

Counts the number of correspondences (e.g., valid or invalid) between image and object points for a specified pose.

Parameters
poseIdThe id of the pose for which the number of point correspondences is determined
referenceObjectPointA reference object point allowing to filter the correspondences to count
minimalPriorityThe minimal priority value an object point must have so that is will be investigated
Returns
The resulting number of correspondences
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the correspondences; False, if the defined position will not match the positions of the correspondences
tNeedValidPoseTrue, if the pose must be valid so that the number of valid correspondences will be determined, otherwise the number of correspondences will be zero

◆ numberCorrespondencesSubset()

template<bool tMatchPosition, bool tNeedValidPose>
void Ocean::Tracking::Database::numberCorrespondencesSubset ( const Index32  lowerPoseId,
const Vector3 referenceObjectPoint,
const Scalar  minimalPriority,
unsigned int *  correspondences,
const unsigned int  firstPose,
const unsigned int  numberPoses 
) const
inlineprotected

Counts the number of valid correspondences between image and object points for a subset of several poses individually.

Parameters
lowerPoseIdThe id (index) of the frame defining the lower border of camera poses which will be investigated
referenceObjectPointA reference object point allowing to filter the correspondences to count
minimalPriorityThe minimal priority value an object point must have so that is will be investigated
correspondencesThe resulting correspondences, one for each frame, starting with 'lowerPoseId' (the first entry corresponds to 'lowerPoseId' and so on)
firstPoseThe index (not the id) of the first pose to handle
numberPosesThe number of poses to handle
Template Parameters
tMatchPositionTrue, if the defined position will match the positions of the correspondences; False, if the defined position will not match the positions of the correspondences
tNeedValidPoseTrue, if the pose must be valid so that the number of valid correspondences will be determined, otherwise the number of correspondences will be zero

◆ numberImagePointsFromObjectPoint()

template<bool tThreadSafe>
size_t Ocean::Tracking::Database::numberImagePointsFromObjectPoint ( const Index32  objectPointId) const
inline

Returns the number of image point observations which belong to a given object point.

Parameters
objectPointIdThe id of the object point for which the number of observations are requested, must be valid
Returns
The number of image point observations of the given object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ numberObservations()

template<bool tThreadSafe>
unsigned int Ocean::Tracking::Database::numberObservations ( const Index32  poseId,
const Indices32 objectPointIds 
) const
inline

Counts the number of observations of a given set of object point ids for a specific camera frame.

Parameters
poseIdThe id of the pose for which the number of visible object points is determined
objectPointIdsthe ids of the object point for which the number of observations is determined
Returns
The number of object points (from the given set of object points) which are visible in the defined pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ numberValidPoses()

unsigned int Ocean::Tracking::Database::numberValidPoses ( const Index32  objectPointId,
const IndexSet32 imagePointIds 
) const
inlineprotected

Counts the number of valid poses of a given object point.

Parameters
objectPointIdThe id of the object point for which the number of valid poses is determined
imagePointIdsThe ids of the image points which are the projections of the defined object point (must be extracted from the ObjectPointData object of the given object point)
Returns
The number of valid camera poses

◆ objectPoint() [1/2]

template<bool tThreadSafe>
const Vector3 & Ocean::Tracking::Database::objectPoint ( const Index32  objectPointId) const
inline

Returns the location of an object point which is specified by the id of the object point.

Beware: The requested object point must exist in this database.

Parameters
objectPointIdThe unique id of the object point, must be valid
Returns
The location of the specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPoint() [2/2]

template<bool tThreadSafe>
const Vector3 & Ocean::Tracking::Database::objectPoint ( const Index32  objectPointId,
Scalar objectPointPriority 
) const
inline

Returns the location and priority of an object point which is specified by the id of the object point.

Beware: The requested object point must exist in this database.

Parameters
objectPointIdThe unique id of the object point, must be valid
objectPointPriorityThe resulting priority of the specified object point
Returns
The location of the specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointFromImagePoint()

template<bool tThreadSafe>
Index32 Ocean::Tracking::Database::objectPointFromImagePoint ( const Index32  imagePointId) const
inline

Returns the object point which belongs to a given image point.

Each image point can be the projection of at most one unique object point.
Beware: The specified image point may not be connected to an object point, in this case the resulting id is an invalid id.

Parameters
imagePointIdThe id of the image point for which the corresponding object point is requested
Returns
The id of the corresponding object point, may be invalid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointIds() [1/9]

template<bool tThreadSafe, bool tMatchPosition, bool tVisibleInAllPoses>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Index32  lowerPoseId,
const Index32  upperPoseId,
const Vector3 referencePosition = invalidObjectPoint(),
const Scalar  minimalPriority = Scalar(-1),
Vectors3 objectPoints = nullptr 
) const

Returns all ids of object points which are visible in a specified frame range.

The function allows to determine object points which are visible in all frames of the specified frame range or in any of the frames.

Parameters
lowerPoseIdPose id defining the lower pose id border of all poses which will be investigated
upperPoseIdPose id defining the lower pose id border of all poses which will be investigated, with range [lowerPoseId, infinity)
referencePositionThe 3D reference position which is used to filter the object points
minimalPriorityThe minimal priority value an object point must have so that it will be investigated
objectPointsOptional resulting positions of the resulting object point ids
Returns
All object point ids visible in the specified frames
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points
tVisibleInAllPosesTrue, if the object points must be visible in all poses (frames) of the specified pose range; False, if the object point can be visible in any poses (frames) within the specified pose range

◆ objectPointIds() [2/9]

template<bool tThreadSafe, bool tMatchPosition>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Index32  poseId,
const Vector3 referencePosition,
const Scalar  minimalPriority = Scalar(-1),
Vectors3 objectPoints = nullptr 
) const

Returns all ids of object points which are visible in a specified frame and which match or do not match a specified reference position.

Parameters
poseIdThe id of the camera pose in which frame the object points are visible
referencePositionThe 3D reference position which is used to filter the object points
minimalPriorityThe minimal priority value an object point must have so that it will be investigated
objectPointsOptional resulting positions of the resulting object point ids
Returns
All object point ids visible in the specified frame
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points

◆ objectPointIds() [3/9]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Index32  poseId,
Vectors3 objectPoints = nullptr 
) const

Returns all ids of object points which are visible in a specified frame.

Parameters
poseIdThe id of the camera pose in which frame the object points are visible
objectPointsOptional resulting positions of the resulting object point ids
Returns
All object point ids visible in the specified frame
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointIds() [4/9]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::objectPointIds ( const IndexSet32 outlierObjectPointIds) const

Returns the ids of all object points that are part of this database and which are not provided by the explicit set of outlier object point ids.

Parameters
outlierObjectPointIdsThe ids of all object points which will not be returned
Returns
The object point ids
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointIds() [5/9]

template<bool tThreadSafe, bool tMatchPosition>
Indices32 Ocean::Tracking::Database::objectPointIds ( const IndexSet32 outlierObjectPointIds,
const Vector3 referencePosition,
Vectors3 objectPoints = nullptr,
const Scalar  minimalPriority = Scalar(-1) 
) const

Returns the ids of all object points with a specific location and having a priority value larger or equal to a given threshold as long as the object point is not defined in the explicit set of outlier object point ids.

Parameters
outlierObjectPointIdsThe ids of all object points which will not be returned
referencePositionA 3D point value allowing to filter the resulting object point ids
objectPointsOptional resulting object point positions, one position for each resulting id
minimalPriorityThe minimal priority value an object point must have to that it will be returned (if it matches the reference position)
Returns
The object point ids
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points

◆ objectPointIds() [6/9]

template<bool tThreadSafe, bool tMatchPosition, bool tVisibleInAllPoses>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Indices32 poseIds,
const Vector3 referencePosition = invalidObjectPoint(),
const Scalar  minimalPriority = Scalar(-1),
Vectors3 objectPoints = nullptr 
) const

Returns all ids of object points which are visible in specified keyframes.

The function allows to determine object points which are visible in all keyframes or in any of the keyframes.

Parameters
poseIdsThe ids of the keyframes which will be investigated
referencePositionThe 3D reference position which is used to filter the object points
minimalPriorityThe minimal priority value an object point must have so that it will be investigated
objectPointsOptional resulting positions of the resulting object point ids
Returns
All object point ids visible in the specified frames
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points
tVisibleInAllPosesTrue, if the object points must be visible in all poses (frames) of the specified pose range; False, if the object point can be visible in any poses (frames) within the specified pose range

◆ objectPointIds() [7/9]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Indices32  poseIds,
Vectors3 objectPoints = nullptr 
) const

Returns all ids of object points which are visible in several specified frames.

Parameters
poseIdsThe ids of the camera poses in which frame the object points are visible
objectPointsOptional resulting positions of the resulting object point ids
Returns
All object point ids visible in the specified frames
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointIds() [8/9]

template<bool tThreadSafe, bool tMatchPosition>
Indices32 Ocean::Tracking::Database::objectPointIds ( const Vector3 referencePosition,
Vectors3 objectPoints = nullptr,
const Scalar  minimalPriority = Scalar(-1) 
) const

Returns all object points with a specific location and priority value larger or equal to a given threshold.

Parameters
referencePositionA 3D point value allowing to filter the resulting object point ids
objectPointsOptional resulting object point positions, one position for each resulting id
minimalPriorityThe minimal priority value an object point must have to that it will be returned (if it matches the reference position)
Returns
The ids of all object points that have the given position
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points
See also
objectPoints().

◆ objectPointIds() [9/9]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::objectPointIds ( Vectors3 objectPoints = nullptr,
Scalars priorities = nullptr 
) const

Returns the ids of all object points that are part of this database.

Parameters
objectPointsOptional resulting object points, one for each resulting object point id, nullptr if not of interest
prioritiesOptional resulting object point priorities, one for each resulting object point id, nullptr if not of interest
Returns
The object point ids
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPointIdsWithNumberOfObservations()

template<bool tThreadSafe, bool tMatchPosition>
IndexPairs32 Ocean::Tracking::Database::objectPointIdsWithNumberOfObservations ( const Vector3 referencePosition,
const Scalar  minimalPriority = Scalar(-1),
Worker worker = nullptr 
) const
inline

Returns pairs of object point ids combined with counts of valid observations.

The ids are id of object points which have a specified 3D position or which do not have a specified 3D position.

Parameters
referencePositionThe 3D reference position which is used to filter the object points
minimalPriorityThe minimal priority value an object point must have to be identified as candidate
workerOptional worker object to distribute the computation
Returns
Pairs of object point ids and numbers of valid camera poses for the individual object points
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points

◆ objectPointIdsWithNumberOfObservationsSubset()

template<bool tMatchPosition>
void Ocean::Tracking::Database::objectPointIdsWithNumberOfObservationsSubset ( const Index32 objectPointIds,
const Vector3 referencePosition,
const Scalar  minimalPriority,
IndexPairs32 pairs,
Lock lock,
const unsigned int  firstObjectPoint,
const unsigned int  numberObjectPoints 
) const
protected

Returns pairs of object point ids combined with counts of valid observations.

Parameters
objectPointIdsThe ids of the object points for which the number of observations is determined
referencePositionThe 3D position of the object points to find or to avoid (e.g., may be an invalid position to identify all invalid object points)
minimalPriorityThe minimal priority value an object point must have to be identified as candidate
pairsThe resulting pairs of object point ids and numbers of valid camera poses for the individual object points
lockOptional lock object, must be defined if the function is executed on several threads in parallel
firstObjectPointThe first object point to be handled
numberObjectPointsThe number of object points to be handled
Template Parameters
tMatchPositionTrue, if the defined position will match the positions of the resulting object points; False, if the defined position will not match the positions of the resulting object points
See also
objectPointIdsWithNumberOfObservations().

◆ objectPointNumber()

template<bool tThreadSafe>
size_t Ocean::Tracking::Database::objectPointNumber
inline

Returns the number of object point ids in this database.

Returns
The database's object point id number

◆ objectPointPriority()

template<bool tThreadSafe>
Scalar Ocean::Tracking::Database::objectPointPriority ( const Index32  objectPointId) const
inline

Returns the priority of an object point which is specified by the id of the object point.

Beware: The requested object point must exist in this database.

Parameters
objectPointIdThe unique id of the object point, must be valid
Returns
The priority of the specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPoints() [1/3]

template<bool tThreadSafe>
Vectors3 Ocean::Tracking::Database::objectPoints
inline

Returns the positions of all 3D object points.

Returns
The resulting object point positions
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPoints() [2/3]

template<bool tThreadSafe>
Vectors3 Ocean::Tracking::Database::objectPoints ( const Indices32 objectPointIds) const
inline

Returns the positions of 3D object points specified by the ids of the object points.

Parameters
objectPointIdsThe ids of the object points for which the positions will be returned, must be valid
Returns
The resulting object point positions, one position for each id
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ objectPoints() [3/3]

template<bool tThreadSafe, bool tMatchPosition>
Vectors3 Ocean::Tracking::Database::objectPoints ( const Vector3 referencePosition,
Indices32 objectPointIds = nullptr,
const Scalar  minimalPriority = Scalar(-1) 
) const
inline

Returns the positions of all 3D object points that match or that do not match the position of a specified reference object point and which have a specified minimal priority value.

Returns
The resulting object point positions
Parameters
referencePositionAn object point position which is used to filter the resulting object points
objectPointIdsOptional resulting ids of the resulting valid object points, on id for each object point
minimalPriorityThe minimal priority value an object points must have to be returned
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined reference position will match the positions of the resulting object points; False, if the defined reference position will not match the positions of the resulting object points
See also
objectPointIds().

◆ objectPointTopology()

static PoseImagePointTopologyGroups Ocean::Tracking::Database::objectPointTopology ( const TopologyTriples topologyTriples,
const Indices32 indices = nullptr 
)
static

Converts the set of topology triples into a representation which is forced/oriented by object points so that the camera poses and image points can be accessed for a specific object points.

Parameters
topologyTriplesThe set of topology triples which will be converted
indicesOptional subset of the given topology, the indices of the topology triples that will be added to the resulting (object point forced) data structure, nullptr to use all triples
Returns
The object point forced data structure of the given topology triples

◆ observationsFromObjectPoint() [1/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::observationsFromObjectPoint ( const Index32  objectPointId,
const Indices32 poseIdCandidates,
Indices32 validPoseIndices,
Indices32 imagePointIds,
Vectors2 imagePoints = nullptr 
) const
inline

Returns all observations (combination of poses and image points) which belong to a given object point and a set of pose candidates.

Parameters
objectPointIdThe id of the object point for which the connected observations are requested, must be valid
poseIdCandidatesThe candidates of pose ids for which the observation will be checked
validPoseIndicesThe resulting indices of the valid pose candidates
imagePointIdsOptional resulting ids of the image points for which a valid observation exists, one id for each valid pose
imagePointsOptional resulting image points, one point for each image point id
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ observationsFromObjectPoint() [2/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::observationsFromObjectPoint ( const Index32  objectPointId,
Indices32 poseIds,
Indices32 imagePointIds,
Vectors2 imagePoints = nullptr 
) const
inline

Returns all observations (combination of poses and image points) which belong to a given object point.

Parameters
objectPointIdThe id of the object point for which the connected observations are requested, must be valid
poseIdsThe resulting ids of the poses of the observations
imagePointIdsThe resulting ids of the image points of the observations, one id for each pose
imagePointsOptional resulting image points, one point for each image point id
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ operator bool()

Ocean::Tracking::Database::operator bool ( ) const
inlineexplicit

Returns whether this database holds at least one image point, one object point or one camera pose.

Returns
True, if so

◆ operator=() [1/2]

Database & Ocean::Tracking::Database::operator= ( const Database database)
inline

Assign operator copying a second database to this database object.

Parameters
databaseThe database object to be copied
Returns
Reference to this object

◆ operator=() [2/2]

Database & Ocean::Tracking::Database::operator= ( Database &&  database)
inlinenoexcept

Move operator moving a second database to this database object.

Parameters
databaseThe database object to be moved
Returns
Reference to this object

◆ pose()

template<bool tThreadSafe>
const HomogenousMatrix4 & Ocean::Tracking::Database::pose ( const Index32  poseId) const
inline

Returns the 6DOF pose of a camera frame which is specified by the id of the pose.

Beware: The requested pose must exist in this database.

Parameters
poseIdThe unique id of the pose, must be valid
Returns
The specified pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
poses().

◆ poseBorders()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::poseBorders ( Index32 lowerPoseId,
Index32 upperPoseId 
) const
inline

Returns the smallest id (the id of the lower frame border) and the largest id (the id of the upper frame border) of all poses that are known in this database.

This function checks whether the pose (camera frame) is known only, thus the corresponding poses can either be valid or invalid.

Parameters
lowerPoseIdResulting id of the frame defining the lower border of the camera frames which are known
upperPoseIdResulting id of the frame defining the upper border of the camera frames which are known
Returns
True, if at least one pose is known
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
validPoseBorders(), validPoseRange().

◆ poseFromImagePoint()

template<bool tThreadSafe>
Index32 Ocean::Tracking::Database::poseFromImagePoint ( const Index32  imagePointId) const
inline

Determines the camera pose (camera frame) in which a specified image point is visible (to which the image point has been added).

Beware: The specified image point must exist in this database.

Parameters
imagePointIdThe id of the image point for which the corresponding camera pose is requested, must be valid
Returns
The unique id of the camera pose in which the specified image point is visible, an invalid id if the image point has not been added to any camera pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
attachImagePointToPose(), detachImagePointFromPose().

◆ poseIds() [1/2]

template<bool tThreadSafe, bool tMatchPose>
Indices32 Ocean::Tracking::Database::poseIds ( const HomogenousMatrix4 referencePose,
HomogenousMatrices4 poses = nullptr 
) const
inline

Returns the ids of specific 6DOF poses.

Parameters
referencePoseA pose allowing to filter the resulting pose ids
posesOptional resulting poses, on pose for each id
Returns
The resulting ids of all poses
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPoseTrue, if the defined pose will match the values of the resulting poses; False, if the defined pose will not match the values of the resulting poses
See also
poses().

◆ poseIds() [2/2]

template<bool tThreadSafe>
Indices32 Ocean::Tracking::Database::poseIds ( HomogenousMatrices4 world_T_cameras = nullptr) const

Returns the ids of all poses that are part of this database.

Parameters
world_T_camerasOptional resulting poses, one for each resulting pose id, nullptr if not of interest
Returns
The pose ids
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ poseNumber()

template<bool tThreadSafe>
size_t Ocean::Tracking::Database::poseNumber
inline

Returns the number of poses of this database.

Returns
The database's pose number

◆ poses() [1/3]

template<bool tThreadSafe, bool tMatchPose>
HomogenousMatrices4 Ocean::Tracking::Database::poses ( const HomogenousMatrix4 referencePose,
Indices32 poseIds = nullptr 
) const
inline

Returns all 6DOF poses which match a given reference pose or which do not match a given reference pose.

Parameters
referencePoseA reference pose allowing to filter the resulting poses
poseIdsOptional resulting ids of the resulting valid poses, on id for each valid pose
Returns
The resulting valid poses
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPoseTrue, if the defined pose will match the values of the resulting poses; False, if the defined pose will not match the values of the resulting poses
See also
poseIds().

◆ poses() [2/3]

template<bool tThreadSafe>
HomogenousMatrices4 Ocean::Tracking::Database::poses ( const Index32 poseIds,
const size_t  size 
) const
inline

Returns the 6DOF pose values for all specified pose ids.

Parameters
poseIdsThe ids of the poses for which the 6DOF values will be returned, each pose id must be valid and must exist
sizeThe number of given pose ids
Returns
The resulting 6DOF pose values, one value for each id
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
pose().

◆ poses() [3/3]

template<bool tThreadSafe>
HomogenousMatrices4 Ocean::Tracking::Database::poses ( const Index32  lowerPoseId,
const Index32  upperPoseId 
) const
inline

Returns all 6DOF poses (valid or invalid) lying between a specified range of pose ids.

For unknown frame ids an invalid pose is provided.

Parameters
lowerPoseIdThe id (index) of the frame defining the lower border of camera poses which will be investigated
upperPoseIdThe id (index) of the frame defining the upper border of camera poses which will be investigated, with range [lowerFrame, infinity)
Returns
The poses of this database, the first pose corresponds to the 'lowerFrame' while the last pose corresponds to the 'upperFrame'
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ posesFromObjectPoint()

template<bool tThreadSafe>
IndexSet32 Ocean::Tracking::Database::posesFromObjectPoint ( const Index32  objectPointId) const
inline

Returns all poses which belong to a given object point.

Parameters
objectPointIdThe id of the object point for which the connected poses points are requested, must be valid
Returns
The ids of all poses which are connected with the specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ posesImagePoints()

template<bool tThreadSafe, bool tMatchPose>
void Ocean::Tracking::Database::posesImagePoints ( const Index32  objectPointId,
HomogenousMatrices4 poses,
Vectors2 imagePoints,
const HomogenousMatrix4 referencePose = HomogenousMatrix4(false),
Indices32 poseIds = nullptr,
Indices32 imagePointIds = nullptr,
const Index32  lowerPoseId = invalidId,
const Index32  upperPoseId = invalidId 
) const

Returns corresponding poses and image points for a given object point from the entire range of possible camera poses.

Parameters
objectPointIdThe id of the object point for which the poses and image points are requested
posesThe resulting poses in which the object point is visible
imagePointsThe resulting image points which are the projections of the object points, each image point corresponds with one pose
referencePoseA pose allowing to filter the resulting poses so that either valid or invalid poses are found
poseIdsOptional ids of the resulting poses
imagePointIdsOptional ids of the resulting image points
lowerPoseIdOptional pose id defining the lower pose id border, invalidId if no lower border is defined
upperPoseIdOptional pose id defining the upper pose id border, invalidId if no upper border is defined
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPoseTrue, if the defined pose will match the values of the resulting poses; False, if the defined pose will not match the values of the resulting poses

◆ poseWithLeastCorrespondences()

template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
bool Ocean::Tracking::Database::poseWithLeastCorrespondences ( const Index32  lowerPoseId,
const Index32  upperPoseId,
Index32 poseId = nullptr,
unsigned int *  correspondences = nullptr,
const Vector3 referenceObjectPoint = invalidObjectPoint() 
) const
inline

Determines the pose id for which the database holds the least number of point correspondences (between e.g., valid or invalid object points and image points).

Parameters
lowerPoseIdThe id of the frame defining the lower border of the camera poses which will be investigated, with range [0, infinity)
upperPoseIdThe id of the frame defining the upper border of the camera poses which will be investigated, with range [lowerPoseId, infinity)
poseIdOptional resulting id of the valid pose with least correspondences, with range [lowerPoseId, upperPoseId]
correspondencesOptional resulting number of correspondences for the resulting pose
referenceObjectPointA reference object point allowing to filter the correspondences to count
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the correspondences; False, if the defined position will not match the positions of the correspondences
tNeedValidPoseTrue, if the pose must be valid so that the number of valid correspondences will be determined
See also
poseWithMostCorrespondences().

◆ poseWithMostCorrespondences()

template<bool tThreadSafe, bool tMatchPosition, bool tNeedValidPose>
bool Ocean::Tracking::Database::poseWithMostCorrespondences ( const Index32  lowerPoseId,
const Index32  upperPoseId,
Index32 poseId = nullptr,
unsigned int *  correspondences = nullptr,
const Vector3 referenceObjectPoint = invalidObjectPoint() 
) const
inline

Determines the pose id for which the database holds the most number of point correspondences (between e.g., valid or invalid object points and image points).

Parameters
lowerPoseIdThe id of the frame defining the lower border of the camera poses which will be investigated, with range [0, infinity)
upperPoseIdThe id of the frame defining the upper border of the camera poses which will be investigated, with range [lowerPoseId, infinity)
poseIdOptional resulting id of the valid pose with most correspondences, with range [lowerPoseId, upperPoseId]
correspondencesOptional resulting number of correspondences for the resulting pose
referenceObjectPointA reference object point allowing to filter the correspondences to count
Returns
True, if a pose with at least one correspondence could be found
Template Parameters
tThreadSafeTrue, to call this function thread-safe
tMatchPositionTrue, if the defined position will match the positions of the correspondences; False, if the defined position will not match the positions of the correspondences
tNeedValidPoseTrue, if the pose must be valid so that the number of valid correspondences will be determined
See also
poseWithLeastCorrespondences().

◆ poseWithMostObservations()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::poseWithMostObservations ( const IndexSet32 poseCandidates,
const IndexSet32 majorObjectPointIds,
const IndexSet32 minorObjectPointIds,
Index32 poseId,
Indices32 visibleMajorObjectPointIds = nullptr,
Indices32 visibleMinorObjectPointIds = nullptr 
) const
inline

Determines the pose id from a set of given pose id candidates for which the database holds the most observations from a set of given object point ids.

The major object point ids are the essential object point for which the most observations will be determined.
If more than one pose with the same number of most major object point observations can be determined the second set of object points (the minor object points) are used to identify the final pose with most observations.

Parameters
poseCandidatesThe ids of all poses from which the best pose is determined
majorObjectPointIdsThe ids of all major object points which are the essential object points for the resulting pose, at least one
minorObjectPointIdsThe ids of all minor object points
poseIdThe resulting id of the pose with most visible major object points (and minor object points, if more than two poses exist with same number of best visible major object points)
visibleMajorObjectPointIdsOptional resulting ids of all major object points visible in the resulting pose
visibleMinorObjectPointIdsOptional resulting ids of all minor object points visible in the resulting pose
Returns
True, at least one pose exists in which at least one major object point is visible
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ reliableObjectPoints()

Indices32 Ocean::Tracking::Database::reliableObjectPoints ( const TopologyTriples topologyTriples,
const unsigned int  minimalObservations 
)
inlinestatic

Determines reliable object points from a set of given topology triples (by determining all object points with a minimal number of observations).

Parameters
topologyTriplesThe set of topology triples from which the reliable object points are determined
minimalObservationsThe minimal number of observations (the number of camera poses in which the object point is visible) an object point must have to count as reliable
Returns
The ids of the reliable object points

◆ removeImagePoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::removeImagePoint ( const Index32  imagePointId)
inline

Removes an image point from this database.

Beware: The specified image point must exist in this database.

Parameters
imagePointIdThe id of the image point which will be removed, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ removeObjectPoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::removeObjectPoint ( const Index32  objectPointId)
inline

Removes an object point from this database.

Beware: The specified object point must exist in this database.

Parameters
objectPointIdThe id of the object point which will be removed, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ removeObjectPointAndAttachedImagePoints()

template<bool tThreadSafe>
void Ocean::Tracking::Database::removeObjectPointAndAttachedImagePoints ( const Index32  objectPointId)

Removes an object point from this database and also removes all image points attached to the object point.

Parameters
objectPointIdThe id of the object point which will be removed, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ removePose()

template<bool tThreadSafe>
void Ocean::Tracking::Database::removePose ( const Index32  poseId)
inline

Removes a pose from this database.

Beware: The specified pose must exist in this database.

Parameters
poseIdThe id of the pose which will be removed, must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ renameObjectPoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::renameObjectPoint ( const Index32  oldObjectPointId,
const Index32  newObjectPointId 
)
inline

Renames an object point, changes the id of the object point respectively.

Beware: Do not mix calls with the add-objectPoint-function creating the id on its own.

Parameters
oldObjectPointIdThe old (the current) id of the object point to be changed, must be valid
newObjectPointIdThe new id of the object point, must be valid, must not exist
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ reset() [1/2]

template<typename T , bool tThreadSafe>
void Ocean::Tracking::Database::reset ( const size_t  numberPoses,
const Index32 poseIds,
const HomogenousMatrixT4< T > *  poses,
const size_t  numberObjectPoints,
const Index32 objectPointIds,
const VectorT3< T > *  objectPoints,
const T *  objectPointPriorities,
const size_t  numberImagePoints,
const Index32 imagePointIds,
const VectorT2< T > *  imagePoints,
const Index32 topologyPoseIds,
const Index32 topologyObjectPointIds 
)

Resets this database with given poses, object points, image points, and topology.

Parameters
numberPosesThe number of the provided poses, with range [0, infinity)
poseIdsThe ids of all poses, nullptr if 'numberPoses == 0'
posesThe poses, one for each pose id, nullptr if 'numberPoses == 0'
numberObjectPointsThe number of the provided object points, with range [0, infinity)
objectPointIdsThe ids of all object points, nullptr if 'numberObjectPoints == 0'
objectPointsThe object points, one for each object point id, nullptr if 'numberObjectPoints == 0'
objectPointPrioritiesThe priorities of the object points, one for each object point id, nullptr if 'numberObjectPoints == 0'
numberImagePointsThe number of provided image points, with range [0, infinity)
imagePointIdsThe ids of all image points, nullptr if 'numberImagePoints == 0'
imagePointsThe image points, one for each image point id, nullptr if 'numberImagePoints == 0'
topologyPoseIdsThe ids of the poses to which an image point belongs, one for each image point, 'invalidId' if unknown
topologyObjectPointIdsThe ids of all object points to which an image point belongs, one for each image point, 'invalidId' if unknown

◆ reset() [2/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::reset ( const Vector3 referenceObjectPoint = invalidObjectPoint(),
const HomogenousMatrix4 referencePose = HomogenousMatrix4(false) 
)
inline

Resets the geometric information of this database for 3D object points and 6DOF camera poses.

However, the 2D image point locations are untouched.

Parameters
referenceObjectPointThe new object point value for each object point of this database
referencePoseThe new pose value for each pose of this database
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ rotationalPoses()

template<bool tThreadSafe>
SquareMatrices3 Ocean::Tracking::Database::rotationalPoses ( const Index32 poseIds,
const size_t  size 
) const
inline

Returns the 3DOF rotational part of the 6DOF pose values for all specified pose ids.

The camera motion of this database must be pure rotational so that the position of each camera pose is in the origin of the coordinate system.

Parameters
poseIdsThe ids of the poses for which the rotational values will be returned, each pose id must be valid and must exist
sizeThe number of given pose ids
Returns
The resulting 3DOF orientations of the camera, one value for each id
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
pose().

◆ secondIndex()

Index32 Ocean::Tracking::Database::secondIndex ( const Index64  index)
inlinestaticprotected

Returns the second 32 bit index of a 64 bit index.

Parameters
indexThe 64 bit index
Returns
Second 32 bit index

◆ setImagePoint()

template<bool tThreadSafe>
void Ocean::Tracking::Database::setImagePoint ( const Index32  imagePointId,
const Vector2 imagePoint 
)
inline

Sets (changes) an image point.

Parameters
imagePointIdThe id of the image point which will be changed, must be valid
imagePointThe new 2D position of the image point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ setObjectPoint() [1/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPoint ( const Index32  objectPointId,
const Vector3 objectPoint 
)
inline

Sets (changes) an object point without modifying the priority value of the object point.

Parameters
objectPointIdThe id of the object point which will be changed, must be valid
objectPointThe new 3D position of the object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setObjectPoints().

◆ setObjectPoint() [2/2]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPoint ( const Index32  objectPointId,
const Vector3 objectPoint,
const Scalar  priority 
)
inline

Sets (changes) an object point.

Parameters
objectPointIdThe id of the object point which will be changed, must be valid
objectPointThe new 3D position of the object point
priorityThe new priority value of the object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ setObjectPointPriority()

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPointPriority ( const Index32  objectPointId,
const Scalar  priority 
)
inline

Sets (changes) the priority value of an object point.

Parameters
objectPointIdThe id of the object point which priority value will be changed, must be valid
priorityThe priority value to be set
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ setObjectPoints() [1/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPoints ( const Index32 objectPointIds,
const size_t  number,
const Vector3 referenceObjectPoint 
)
inline

Sets (changes) a set of object points without modifying the priority value of the object points.

All object points receive the same position e.g., an invalid object point position.

Parameters
objectPointIdsThe ids of the object points which will be changed, must all be valid
numberThe number of object points which will be updated
referenceObjectPointThe one unique object point position to set for each specified object point
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setObjectPoint().

◆ setObjectPoints() [2/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPoints ( const Index32 objectPointIds,
const Vector3 objectPoints,
const size_t  number 
)
inline

Sets (changes) a set of object points without modifying the priority value of the object points.

Parameters
objectPointIdsThe ids of the object points which will be changed, must all be valid
objectPointsThe new 3D positions of the object points, one position for each object point id
numberThe number of object points which will be updated
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setObjectPoint().

◆ setObjectPoints() [3/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setObjectPoints ( const Vector3 objectPoint = invalidObjectPoint())
inline

Sets (changes) all object points to one unique position without modifying the priority value of the object points.

Parameters
objectPointThe 3D position of all object points
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setObjectPoint().

◆ setPose()

template<bool tThreadSafe>
void Ocean::Tracking::Database::setPose ( const Index32  poseId,
const HomogenousMatrix4 pose 
)
inline

Sets (changes) a pose.

Parameters
poseIdThe id of the pose to be changed, must be valid
poseThe new pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ setPoses() [1/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setPoses ( const HomogenousMatrix4 pose)
inline

Sets (changes) all poses to one unique pose value.

Parameters
poseThe pose value of all poses
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setPose().

◆ setPoses() [2/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setPoses ( const Index32 poseIds,
const HomogenousMatrix4 poses,
const size_t  number 
)
inline

Sets (changes) a set of poses.

Parameters
poseIdsThe ids of the poses which will be changed, must all be valid
posesThe new poses, one pose for each pose id
numberThe number of poses which will be updated
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setPose().

◆ setPoses() [3/3]

template<bool tThreadSafe>
void Ocean::Tracking::Database::setPoses ( const ShiftVector< HomogenousMatrix4 > &  poses)
inline

Sets (changes) a set of poses.

Parameters
posesThe poses to set, the indices of the pose correspond with the ids of the poses, each pose id must be valid
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
setPose().

◆ topologyTriples()

template<bool tThreadSafe>
Database::TopologyTriples Ocean::Tracking::Database::topologyTriples ( const Indices32 poseIds) const

Returns topology triples with valid image points ids, object points ids and pose ids for a set of given pose ids.

Parameters
poseIdsThe ids of the camera pose for which the topology triples are requested.
Returns
The resulting topology triples
Template Parameters
tThreadSafeTrue, to call this function thread-safe

◆ validPoseBorders()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::validPoseBorders ( Index32 rangeLowerPoseId,
Index32 rangeUpperPoseId 
) const
inline

Returns the smallest id (the id of the lower frame border) and the largest id (the id of the upper frame border) with a valid pose (from all known poses in this database.

Beware: There may be frame ids with invalid poses in-between.

Parameters
rangeLowerPoseIdResulting id of the frame defining the lower border of the camera frames with valid pose
rangeUpperPoseIdResulting id of the frame defining the upper border of the camera frames with valid pose
Returns
True, if at least one valid pose is known
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
poseBorders().

◆ validPoseRange()

template<bool tThreadSafe>
bool Ocean::Tracking::Database::validPoseRange ( const Index32  lowerPoseId,
const Index32  startPoseId,
const Index32  upperPoseId,
Index32 rangeLowerPoseId,
Index32 rangeUpperPoseId 
) const
inline

Determines the pose id range (around a specified start frame) for which the database holds valid poses.

Parameters
lowerPoseIdThe id of the frame defining the lower border of the camera poses which will be investigated, with range [0, infinity)
startPoseIdThe id of the start frame / start pose, with range [lowerPoseId, upperPoseId]
upperPoseIdThe id of the frame defining the upper border of the camera poses which will be investigated, with range [startPoseId, infinity)
rangeLowerPoseIdResulting id of the first camera pose/camera frame with valid camera pose, with range [lowerPoseId, upperPoseId]
rangeUpperPoseIdResulting id of the last camera pose/camera frame with valid camera pose, with range [rangeLowerPoseId, upperPoseId]
Returns
True, if the resulting range holds at least one valid pose
Template Parameters
tThreadSafeTrue, to call this function thread-safe
See also
largestValidPoseRange(), poseBorders().

Field Documentation

◆ databaseImagePointIdCounter

Index32 Ocean::Tracking::Database::databaseImagePointIdCounter
protected

The counter for unique image point ids.

◆ databaseImagePointMap

ImagePointMap Ocean::Tracking::Database::databaseImagePointMap
protected

The map mapping unique image points ids to image point data instances.

◆ databaseLock

Lock Ocean::Tracking::Database::databaseLock
mutableprotected

The lock for the entire database.

◆ databaseObjectPointIdCounter

Index32 Ocean::Tracking::Database::databaseObjectPointIdCounter
protected

The counter for unique object point ids.

◆ databaseObjectPointMap

ObjectPointMap Ocean::Tracking::Database::databaseObjectPointMap
protected

The map mapping unique object point ids to object point data instances.

◆ databasePoseMap

PoseMap Ocean::Tracking::Database::databasePoseMap
protected

The map mapping unique pose ids to pose data instances.

◆ databasePoseObjectPointMap

Index64To32Map Ocean::Tracking::Database::databasePoseObjectPointMap
protected

The map mapping a pair of pose id and object point id to image point ids.

◆ databasePoses

unsigned int Ocean::Tracking::Database::databasePoses
protected

The number of poses.

◆ invalidId

const Index32 Ocean::Tracking::Database::invalidId = Index32(-1)
static

Definition of an invalid id.


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