8#ifndef META_OCEAN_TRACKING_POINT_POSE_POINT_PAIR_H
9#define META_OCEAN_TRACKING_POINT_POSE_POINT_PAIR_H
70 inline unsigned int poseId()
const;
132 inline unsigned int objectId()
const;
138 inline unsigned int size()
const;
144 inline unsigned int failureCounter()
const;
149 inline void incrementFailure();
154 inline void resetFailure();
166 inline void addPosePointPair(
const PosePointPair& posePointPair);
173 inline void addPosePointPair(
const unsigned int poseId,
const unsigned int imagePointId);
234 inline void invalidate();
240 inline bool isValid()
const;
253 explicit inline operator bool()
const;
258 unsigned int dataObjectId = (
unsigned int)(-1);
264 unsigned int dataFailureCounter = 0u;
274 pairImagePointId(imagePointId)
303 dataObjectId(objectId),
304 dataPosePointPairs(posePointPairs)
310 dataObjectId(object.dataObjectId),
311 dataPosePointPairs(std::move(object.dataPosePointPairs)),
312 dataFailureCounter(object.dataFailureCounter)
314 object.dataObjectId = (
unsigned int)(-1);
318 dataObjectId(newObjectId),
319 dataPosePointPairs(newPosePointPairs)
371 result.push_back(database.
pose<
false>(dataPosePointPair.poseId()));
379 return PinholeCamera ::standard2InvertedFlipped(
poses(database));
389 result.push_back(database.
imagePoint<
false>(dataPosePointPair.imagePointId()));
402 ocean_assert(
poses.empty());
408 poses.push_back(database.
pose<
false>(dataPosePointPair.poseId()));
425 posesIF = PinholeCamera ::standard2InvertedFlipped(
poses(database));
454 object.dataObjectId = (
unsigned int)(-1);
460inline PosePointPairsObject::operator bool()
const
This class implements a database for 3D object points, 2D image points and 6DOF camera poses.
Definition Database.h:67
const Vector2 & imagePoint(const Index32 imagePointId) const
Returns the location of an image point which is specified by the id of the image point.
Definition Database.h:2251
const HomogenousMatrix4 & pose(const Index32 poseId) const
Returns the 6DOF pose of a camera frame which is specified by the id of the pose.
Definition Database.h:2444
bool hasPose(const Index32 poseId, HomogenousMatrix4 *pose=nullptr) const
Returns whether this database holds a specified camera pose.
Definition Database.h:3369
const Vector3 & objectPoint(const Index32 objectPointId) const
Returns the location of an object point which is specified by the id of the object point.
Definition Database.h:2335
Definition of a simple struct combining a pose and an image point id.
Definition PosePointPair.h:51
void extractPair(const Database &database, HomogenousMatrix4 &pose, Vector2 &imagePoint) const
Extracts the pose and the image point of this pair.
Definition PosePointPair.h:289
PosePointPair()
Creates an invalid pair.
Definition PosePointPair.h:267
unsigned int imagePointId() const
Returns the image point id of this pair.
Definition PosePointPair.h:284
unsigned int poseId() const
Returns the pose id of this pair.
Definition PosePointPair.h:279
unsigned int pairPoseId
Id of the pose.
Definition PosePointPair.h:89
unsigned int pairImagePointId
Id of th point.
Definition PosePointPair.h:92
Definition of an object that combines an object id with the pairs of poses and image points.
Definition PosePointPair.h:100
HomogenousMatrices4 posesIF(const Database &database) const
Returns the inverted and flipped poses of this object.
Definition PosePointPair.h:377
const PosePointPairs & posePointPairs() const
Returns the pose point pairs of this objects.
Definition PosePointPair.h:349
void extractObject(const Database &database, HomogenousMatrices4 &poses, Vectors2 &imagePoints, Vector3 &objectPoint)
Extracts the poses, the image points and the object point of this object.
Definition PosePointPair.h:400
void addPosePointPair(const PosePointPair &posePointPair)
Adds a new pose point pair to this object.
Definition PosePointPair.h:354
unsigned int size() const
Returns the number of poses and corresponding image points that object covers.
Definition PosePointPair.h:329
void incrementFailure()
Increments the failure counter by one.
Definition PosePointPair.h:339
void invalidate()
Invalidates this object.
Definition PosePointPair.h:436
void extractObjectIF(const Database &database, HomogenousMatrices4 &posesIF, Vectors2 &imagePoints, Vector3 &objectPoint)
Extracts the poses, the image points and the object point of this object.
Definition PosePointPair.h:420
unsigned int objectId() const
Returns the id of the object point of this object.
Definition PosePointPair.h:324
bool isValid() const
Returns whether this object holds a valid id of an object point.
Definition PosePointPair.h:441
PosePointPairs dataPosePointPairs
Pose point pairs.
Definition PosePointPair.h:261
unsigned int failureCounter() const
Returns the failure counter.
Definition PosePointPair.h:334
PosePointPairsObject()
Creates an invalid object.
Definition PosePointPair.h:297
unsigned int dataFailureCounter
Failure counter.
Definition PosePointPair.h:264
HomogenousMatrices4 poses(const Database &database) const
Returns the poses of this object.
Definition PosePointPair.h:364
PosePointPairsObject & operator=(PosePointPairsObject &&object)
Assign operator.
Definition PosePointPair.h:446
unsigned int dataObjectId
Id of the object.
Definition PosePointPair.h:258
void resetFailure()
Resets the failure counter to zero.
Definition PosePointPair.h:344
Vectors2 imagePoints(const Database &database) const
Returns the image points of this object.
Definition PosePointPair.h:382
bool optimizeObjectPoint(Database &database, const PinholeCamera &pinholeCamera, const bool useCameraDistortionParameters)
Optimizes the object point according to the pose and image points of this object.
Vector3 objectPoint(const Database &database) const
Returns the object point of this object.
Definition PosePointPair.h:395
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition Vector2.h:64
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition HomogenousMatrix4.h:73
std::vector< PosePointPair > PosePointPairs
Definition of a vector holding pose point pairs.
Definition PosePointPair.h:35
std::vector< PosePointPairsObject > PosePointPairsObjects
Definition of a vector holding pose objects.
Definition PosePointPair.h:44
The namespace covering the entire Ocean framework.
Definition Accessor.h:15