8#ifndef META_OCEAN_TRACKING_OCULUSTAGS_OCULUSTAGTRACKER_H
9#define META_OCEAN_TRACKING_OCULUSTAGS_OCULUSTAGTRACKER_H
175 inline size_t size()
const;
181 inline bool empty()
const;
664 ocean_assert(world_T_camera.
isValid());
665 ocean_assert(objectPoints.empty() ==
false);
666 ocean_assert(objectPoints.size() == imagePoints.size());
667 ocean_assert(trackingImagePoints.size() >= 4);
668 ocean_assert(trackingImagePoints.size() == trackingObjectPoints.size());
679 if (otherObservationHistory.
empty())
690 ocean_assert(otherObservationHistory.
empty());
691 ocean_assert(!otherCameraPoses_world_T_camera.empty());
692 ocean_assert(otherCameraPoses_world_T_camera.size() == otherObjectPointsGroup.size());
693 ocean_assert(otherCameraPoses_world_T_camera.size() == otherImagePointsGroup.size());
694 ocean_assert(otherCameraPoses_world_T_camera.size() == otherTrackingImagePointsGroup.size());
695 ocean_assert(otherCameraPoses_world_T_camera.size() == otherTrackingObjectPointsGroup.size());
697 for (
size_t i = 0; i < otherCameraPoses_world_T_camera.size(); ++i)
699 addObservation(otherCameraPoses_world_T_camera[i], std::move(otherObjectPointsGroup[i]), std::move(otherImagePointsGroup[i]), std::move(otherTrackingImagePointsGroup[i]), std::move(otherTrackingObjectPointsGroup[i]));
784 ocean_assert(
empty() ==
false);
792 ocean_assert(
empty() ==
false);
809 *
this = std::move(otherTrackedTag);
813 tag_(std::move(tag)),
819 ocean_assert(
tag_.isValid());
831 if (
this != &otherTrackedTag)
833 tag_ = std::move(otherTrackedTag.tag_);
This class implements a frame pyramid.
Definition FramePyramid.h:46
This class implements Ocean's image class.
Definition Frame.h:1969
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition HomogenousMatrix4.h:1800
A history of tag observations for one camera Each observation consists of a camera pose,...
Definition OculusTagTracker.h:139
const Geometry::ImagePointGroups & imagePointsGroups() const
Returns the image points stored in this instance.
Definition OculusTagTracker.h:752
size_t removeObservations(const AnyCamera &anyCamera, const HomogenousMatrix4 &tag_T_world, const Scalar maximalError, const Scalar maximalOutliersPercent=Scalar(0.1))
Remove all observations in that do not match the specified pose This function starts with the newest ...
static bool optimizePose(const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const TagObservationHistory &tagObservationHistoryA, const TagObservationHistory &tagObservationHistoryB, const HomogenousMatrix4 &unoptimized_world_T_tag, HomogenousMatrix4 &optimized_world_T_tag)
Stereoscopic optimization of the world-to-tag transformation using the stored object-image point corr...
void addObservation(const HomogenousMatrix4 &world_T_camera, Vectors3 &&objectPoints, Vectors2 &&imagePoints, Vectors2 &&trackingImagePoints, Vectors3 &&trackingObjectPoints)
Adds a single observation of a tag to the collection.
Definition OculusTagTracker.h:662
void append(TagObservationHistory &observationHistory)
Appends a collection of observations.
Definition OculusTagTracker.h:677
bool empty() const
Returns true if no observations are stored in this instance.
Definition OculusTagTracker.h:713
bool optimizePose(const AnyCamera &anyCamera, const HomogenousMatrix4 &unoptimized_world_T_tag, HomogenousMatrix4 &optimized_world_T_tag)
Monoscopic optimization of the world-to-tag transformation using the stored object-image point corres...
size_t size() const
Returns the number of observations.
Definition OculusTagTracker.h:703
HomogenousMatrices4 cameraPoses_world_T_camera_
The world-to-camera transformations.
Definition OculusTagTracker.h:284
const Geometry::ObjectPointGroups & trackingObjectPointsGroups() const
Returns the tracking object points stored in this instance.
Definition OculusTagTracker.h:762
Geometry::ImagePointGroups trackingImagePointsGroups_
The image points that should be used to track the tag from frame to frame (temporally).
Definition OculusTagTracker.h:293
const HomogenousMatrices4 & cameraPoses_world_T_camera() const
Returns the world-to-camera transformations.
Definition OculusTagTracker.h:732
const Vectors3 & latestTrackingObjectPoints() const
Returns the latest object points that should be used for tracking.
Definition OculusTagTracker.h:782
Geometry::ObjectPointGroups trackingObjectPointsGroups_
The image points that should be used to track the tag from frame to frame (temporally).
Definition OculusTagTracker.h:296
void clear()
Removes all stored observations stored in this instance.
Definition OculusTagTracker.h:723
Geometry::ImagePointGroups imagePointsGroups_
The image points corresponding to the object points at the given camera pose.
Definition OculusTagTracker.h:290
const Vectors2 & latestTrackingImagePoints() const
Returns the latest image points that should be used for tracking.
Definition OculusTagTracker.h:790
Geometry::ObjectPointGroups objectPointsGroups_
The object points of the tag (in reference frame of the tag).
Definition OculusTagTracker.h:287
const Geometry::ObjectPointGroups & objectPointsGroups() const
Returns the objects points stored in the instance.
Definition OculusTagTracker.h:742
const Geometry::ImagePointGroups & trackingImagePointsGroups() const
Returns the tracking image points stored in this instance.
Definition OculusTagTracker.h:772
std::vector< Frame > Frames
Definition of a vector holding padding frames.
Definition Frame.h:1932
std::vector< ImagePoints > ImagePointGroups
Definition of a vector holding image points, so we have groups of image points.
Definition geometry/Geometry.h:141
std::vector< ObjectPoints > ObjectPointGroups
Definition of a vector holding object points, so we have groups of object points.
Definition geometry/Geometry.h:135
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition Vector2.h:64
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
AnyCameraT< Scalar > AnyCamera
Definition of an AnyCamera object with Scalar precision.
Definition AnyCamera.h:31
SharedAnyCamerasT< Scalar > SharedAnyCameras
Definition of a vector holding AnyCamera objects.
Definition AnyCamera.h:91
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition HomogenousMatrix4.h:73
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition Vector3.h:65
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the Tracker library.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15