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;
268 pairPoseId((unsigned int)(-1)),
269 pairImagePointId((unsigned int)(-1))
276 pairImagePointId(imagePointId)
300 dataObjectId((unsigned int)(-1)),
301 dataFailureCounter(0u)
307 dataObjectId(objectId),
308 dataPosePointPairs(posePointPairs),
309 dataFailureCounter(0u)
315 dataObjectId(object.dataObjectId),
316 dataPosePointPairs(std::move(object.dataPosePointPairs)),
317 dataFailureCounter(object.dataFailureCounter)
319 object.dataObjectId = (
unsigned int)(-1);
323 dataObjectId(newObjectId),
324 dataPosePointPairs(newPosePointPairs),
325 dataFailureCounter(0u)
376 result.push_back(database.
pose<
false>(i->poseId()));
392 result.push_back(database.
imagePoint<
false>(i->imagePointId()));
404 ocean_assert(
poses.empty());
409 poses.push_back(database.
pose<
false>(i->poseId()));
450 object.dataObjectId = (
unsigned int)(-1);
456 inline PosePointPairsObject::operator bool()
const
static HomogenousMatrixT4< U > standard2InvertedFlipped(const HomogenousMatrixT4< U > &world_T_camera)
Transforms a standard homogenous 4x4 viewing (extrinsic camera) matrix into an inverted and flipped c...
Definition: Camera.h:734
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:2267
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:3276
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:2343
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:291
PosePointPair()
Creates an invalid pair.
Definition: PosePointPair.h:267
unsigned int imagePointId() const
Returns the image point id of this pair.
Definition: PosePointPair.h:286
unsigned int poseId() const
Returns the pose id of this pair.
Definition: PosePointPair.h:281
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:381
const PosePointPairs & posePointPairs() const
Returns the pose point pairs of this objects.
Definition: PosePointPair.h:355
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:402
void addPosePointPair(const PosePointPair &posePointPair)
Adds a new pose point pair to this object.
Definition: PosePointPair.h:360
unsigned int size() const
Returns the number of poses and corresponding image points that object covers.
Definition: PosePointPair.h:335
void incrementFailure()
Increments the failure counter by one.
Definition: PosePointPair.h:345
void invalidate()
Invalidates this object.
Definition: PosePointPair.h:432
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:418
unsigned int objectId() const
Returns the id of the object point of this object.
Definition: PosePointPair.h:330
bool isValid() const
Returns whether this object holds a valid id of an object point.
Definition: PosePointPair.h:437
PosePointPairs dataPosePointPairs
Pose point pairs.
Definition: PosePointPair.h:261
unsigned int failureCounter() const
Returns the failure counter.
Definition: PosePointPair.h:340
PosePointPairsObject()
Creates an invalid object.
Definition: PosePointPair.h:299
unsigned int dataFailureCounter
Failure counter.
Definition: PosePointPair.h:264
HomogenousMatrices4 poses(const Database &database) const
Returns the poses of this object.
Definition: PosePointPair.h:370
PosePointPairsObject & operator=(PosePointPairsObject &&object)
Assign operator.
Definition: PosePointPair.h:442
unsigned int dataObjectId
Id of the object.
Definition: PosePointPair.h:258
void resetFailure()
Resets the failure counter to zero.
Definition: PosePointPair.h:350
Vectors2 imagePoints(const Database &database) const
Returns the image points of this object.
Definition: PosePointPair.h:386
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:397
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
std::vector< PosePointPair > PosePointPairs
Definition of a vector holding pose point pairs.
Definition: PosePointPair.h:29
std::vector< PosePointPairsObject > PosePointPairsObjects
Definition of a vector holding pose objects.
Definition: PosePointPair.h:38
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15