8 #ifndef META_OCEAN_DEVICES_SLAM_TRACKER_6DOF_H
9 #define META_OCEAN_DEVICES_SLAM_TRACKER_6DOF_H
92 static inline std::string deviceNameSLAMTracker6DOF();
98 static inline DeviceType deviceTypeSLAMTracker6DOF();
146 template <
unsigned int tSize>
240 size_t initializationImagePointsDetermined_ = 0;
269 return std::string(
"SLAM Feature Based 6DOF Tracker");
This class implements a frame pyramid.
Definition: FramePyramid.h:37
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
This class implements a device for the SLAM library.
Definition: SLAMDevice.h:29
This class implements a device factory for the SLAM feature based tracking system.
Definition: SLAMFactory.h:29
This class implements an SLAM feature based tracker.
Definition: SLAMTracker6DOF.h:42
static Indices32 extractLocatedImagePointIndices(const size_t numberLocatedPreviousImagePoints, const Indices32 &validIndices)
Extracts the indices of the combined image points belonging to the group of image points for which a ...
static void extractUnlocatedImagePoints(const Vectors2 &combinedImagePoints, const size_t numberLocatedPreviousImagePoints, const Indices32 &validIndices, const HomogenousMatrix4 &pose, ObservationGroups &observationGroups)
Extracts the image points for which no known 3D object point location has been determined already fro...
static void extendTrackingDatabase(const PinholeCamera &pinholeCamera, ObservationGroups &observationGroups, Vectors3 &objectPoints, Vectors2 &imagePoints, const unsigned int minimalObservations=20u)
Extends the tracking database by determining the locations of 3D object points based on the observati...
bool stop() override
Stops the device.
bool isStarted() const override
Returns whether this device is active.
static Vectors2 combineImagePointGroups(const Vectors2 &locatedPreviousImagePoints, const ObservationGroups &unlocatedObservationGroups, const Vectors2 &newObservations)
Combines three groups of image points to one large set of image points.
PinholeCamera camera_
The camera calibration object.
Definition: SLAMTracker6DOF.h:231
static std::string deviceNameSLAMTracker6DOF()
Returns the name of this tracker.
Definition: SLAMTracker6DOF.h:267
Timestamp initializationTimestamp_
The timestamp after which the first stereo vision frame may be used.
Definition: SLAMTracker6DOF.h:243
static Scalar medianObservationAngle(const PinholeCamera &pinholeCamera, const Observations &observations)
Determines the median angle between the mean viewing ray and all individual viewing rays of an object...
Timestamp recentFrameTimestamp_
Most recent sample timestamp.
Definition: SLAMTracker6DOF.h:228
void postPose(const HomogenousMatrix4 &pose, const Timestamp ×tamp)
Posts a new camera pose.
~SLAMTracker6DOF() override
Destructs an SLAM feature based 6DOF tracker object.
std::pair< HomogenousMatrix4, Vector2 > Observation
Definition of a pair holding a camera pose and image point.
Definition: SLAMTracker6DOF.h:50
CV::FramePyramid previousFramePyramid_
The frame pyramid of the previous frame.
Definition: SLAMTracker6DOF.h:255
std::vector< Observations > ObservationGroups
Definition of a vector holding observation groups.
Definition: SLAMTracker6DOF.h:60
Vectors2 initializationFirstImagePoints_
The 2D image points located in the first stereo vision frame which will be used for initialization.
Definition: SLAMTracker6DOF.h:234
std::vector< Observation > Observations
Definition of a vector holding observations.
Definition: SLAMTracker6DOF.h:55
SLAMTracker6DOF()
Creates a new SLAM feature based 6DOF tracker object.
static Vectors2 extractLocatedImagePoints(const Vectors2 &combinedImagePoints, const size_t numberLocatedPreviousImagePoints, const Indices32 &validIndices)
Extracts the image points of already located 3D object points from the set of combined image points.
static void determineFeaturePoints(const Frame &frame, const Vectors2 &alreadyKnownFeaturePoints, Vectors2 &newFeaturePoints, const unsigned int binSize=50u, Worker *worker=nullptr)
Determines feature points in a given camera frame, scatters the feature points into individual bins w...
Vectors2 initializationRecentImagePoints_
The 2D image points located in the recent stereo vision frame which will be used for initialization.
Definition: SLAMTracker6DOF.h:237
CV::FramePyramid currentFramePyramid_
The frame pyramid of the current frame.
Definition: SLAMTracker6DOF.h:252
void threadRun() override
Thread function.
FrameType recentFrameType_
Frame recent type.
Definition: SLAMTracker6DOF.h:225
static DeviceType deviceTypeSLAMTracker6DOF()
Returns the type of this tracker.
Definition: SLAMTracker6DOF.h:272
Vectors2 imagePoints_
The 2D image points currently used for tracking.
Definition: SLAMTracker6DOF.h:249
ObservationGroups observationGroups_
The observation groups of feature point candidates.
Definition: SLAMTracker6DOF.h:261
bool start() override
Starts the device.
bool isObjectTracked(const ObjectId &objectId) const override
Returns whether a specific object is currently actively tracked by this tracker.
static bool trackPoints(const CV::FramePyramid &previousFramePyramid, const CV::FramePyramid ¤tFramePyramid, const Vectors2 &previousImagePoints, Vectors2 ¤tImagePoints, Indices32 &validIndices, Worker *worker=nullptr)
Tracks feature points from a previous frame to the current frame.
static bool determineInitialObjectPoints(const PinholeCamera &pinholeCamera, const Vectors2 &firstImagePoints, const Vectors2 &secondImagePoints, HomogenousMatrix4 &pose, Vectors3 &objectPoints, Indices32 &validImagePoints)
Determines the locations of initial 3D object points from two sets of corresponding image points from...
Timestamp frameTimestamp_
Frame timestamp.
Definition: SLAMTracker6DOF.h:222
Vectors3 objectPoints_
The 3D object points currently used for tracking.
Definition: SLAMTracker6DOF.h:246
This class implements the base for all 6DOF trackers.
Definition: Tracker6DOF.h:39
static DeviceType deviceTypeTracker6DOF()
Definition of this device type.
Definition: Tracker6DOF.h:100
@ TRACKER_VISUAL
Tracker using a visual input for their measurements.
Definition: devices/Tracker.h:62
This class is the base class for all tracker using visual input to create the tracking results.
Definition: devices/VisualTracker.h:41
This class implements Ocean's image class.
Definition: Frame.h:1792
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition: Frame.h:30
This class implements a thread.
Definition: Thread.h:115
This class implements a timestamp.
Definition: Timestamp.h:36
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
float Scalar
Definition of a scalar type.
Definition: Math.h:128
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:37
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
const ObjectId invalidObjectId
Definition of an invalid object id.
Definition: rendering/Rendering.h:65
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15