Ocean
Ocean::Tracking::VisualTracker Class Referenceabstract

This class implements a base class for all visual tracker objects. More...

Inheritance diagram for Ocean::Tracking::VisualTracker:

Data Structures

class  TransformationSample
 Definition of a simple tracking sample combining a tracking object id with a transformation. More...
 

Public Types

typedef unsigned int ObjectId
 Definition of an object id. More...
 
typedef std::vector< TransformationSampleTransformationSamples
 Definition of a vector holding a transformation sample object. More...
 

Public Member Functions

const Vector3maximalPositionOffset () const
 Returns the maximal expected pose position offset between two successive frames for this tracker. More...
 
Scalar maximalOrientationOffset () const
 Returns the maximal expected pose orientation offset between two successive frames for this tracker. More...
 
virtual bool setMaxPositionOffset (const Vector3 &positionOffset)
 Sets or changes the maximal expected pose position offset between two successive frames for this tracker. More...
 
virtual bool setMaxOrientationOffset (const Scalar orientationOffset)
 Sets or changes the maximal expected pose orientation offset between two successive frames for this tracker. More...
 
virtual bool determinePoses (const Frames &frames, const SharedAnyCameras &anyCameras, TransformationSamples &transformations, const Quaternion &world_R_camera=Quaternion(false), Worker *worker=nullptr)
 Executes the tracking step for a collection of frames and corresponding cameras This function allows to specify an absolute orientation 'absoluteOrientation' provided by e.g., an IMU sensor. More...
 
virtual bool determinePoses (const Frame &frame, const PinholeCamera &pinholeCamera, const bool frameIsUndistorted, TransformationSamples &transformations, const Quaternion &world_R_camera=Quaternion(false), Worker *worker=nullptr)=0
 Deprecated. More...
 
- Public Member Functions inherited from Ocean::Tracking::Tracker
 Tracker ()
 Creates a new tracker object. More...
 
virtual ~Tracker ()
 Destructs a new tracker object. More...
 

Protected Member Functions

 VisualTracker ()=default
 Creates a new visual tracker object. More...
 

Protected Attributes

MotionModel motionModel_
 Pose motion model to predict the pose of the next frame. More...
 
Vector3 maxPositionOffset_ = Vector3(Scalar(0.08), Scalar(0.08), Scalar(0.08))
 Maximal pose position offset between two frames. More...
 
Scalar maxOrientationOffset_ = Numeric::deg2rad(15)
 Maximal pose orientation offset between two frames, in radian angle. More...
 
Lock lock_
 Tracker lock object. More...
 

Detailed Description

This class implements a base class for all visual tracker objects.

Member Typedef Documentation

◆ ObjectId

Definition of an object id.

◆ TransformationSamples

Definition of a vector holding a transformation sample object.

Constructor & Destructor Documentation

◆ VisualTracker()

Ocean::Tracking::VisualTracker::VisualTracker ( )
protecteddefault

Creates a new visual tracker object.

Member Function Documentation

◆ determinePoses() [1/2]

virtual bool Ocean::Tracking::VisualTracker::determinePoses ( const Frame frame,
const PinholeCamera pinholeCamera,
const bool  frameIsUndistorted,
TransformationSamples transformations,
const Quaternion world_R_camera = Quaternion(false),
Worker worker = nullptr 
)
pure virtual

Deprecated.

Executes the tracking for a given frame. This function allows to specify an absolute orientation 'absoluteOrientation' provided by e.g., an IMU sensor.
This orientation can be defined in relation to an independent coordinate system not related with the tracking objects (as long as this coordinate system does not change between successive calls).
The tracker can use the provided orientation to improve tracking robustness.

Parameters
frameThe frame to be used for tracking, must be valid
pinholeCameraThe pinhole camera object associated with the frame, with width and height matching with the frame's resolution
frameIsUndistortedTrue, if the original input frame is undistorted and thus feature must not be undistorted explicitly
transformationsResulting 6DOF poses combined with the tracking ids
world_R_cameraOptional absolute orientation of the camera in the moment the frame was taken, defined in a coordinate system (e.g., world) not related with the tracking objects, an invalid object otherwise
workerOptional worker object
Returns
True, if succeeded

Implemented in Ocean::Tracking::Pattern::PatternTracker6DOF, Ocean::Tracking::RMV::RMVFeatureTracker6DOF, and Ocean::Tracking::ORB::FeatureTracker6DOF.

◆ determinePoses() [2/2]

virtual bool Ocean::Tracking::VisualTracker::determinePoses ( const Frames frames,
const SharedAnyCameras anyCameras,
TransformationSamples transformations,
const Quaternion world_R_camera = Quaternion(false),
Worker worker = nullptr 
)
virtual

Executes the tracking step for a collection of frames and corresponding cameras This function allows to specify an absolute orientation 'absoluteOrientation' provided by e.g., an IMU sensor.


This orientation can be defined in relation to an independent coordinate system not related with the tracking objects (as long as this coordinate system does not change between successive calls).
The tracker can use the provided orientation to improve tracking robustness.

Note
The base implementation will only accept a single frame and camera and will return false for multiple frames and cameras. If the camera type is not a pinhole camera, the input frame will be undistorted and the camera will be converted to a pinhole camera, which is an expensive operation. For customization this function needs to be overriden.
Once the deprecated function below has been removed, this function will become purely virtual. For any derived class, it is strongly suggested to provide an override of this function.
Parameters
framesThe frames to be used for tracking, must have at least one element and have same number of elements as anyCameras, all elements must be valid
anyCamerasThe camera objects associated with the frames, with width and height must match that of each corresponding frame, must have same number of elements as frames, all elements must be valid
transformationsThe resulting 6DOF poses combined with the tracking IDs
world_R_cameraAn optional absolute orientation of the camera in the moment the frame was taken, defined in a coordinate system (e.g., world) not related with the tracking objects, an invalid object otherwise
workerAn optional worker object
Returns
True, if succeeded

Reimplemented in Ocean::Tracking::RMV::RMVFeatureTracker6DOF.

◆ maximalOrientationOffset()

Scalar Ocean::Tracking::VisualTracker::maximalOrientationOffset ( ) const
inline

Returns the maximal expected pose orientation offset between two successive frames for this tracker.

Returns
Maximal pose orientation offset in radian

◆ maximalPositionOffset()

const Vector3 & Ocean::Tracking::VisualTracker::maximalPositionOffset ( ) const
inline

Returns the maximal expected pose position offset between two successive frames for this tracker.

Returns
Maximal pose position offset separately for each axis

◆ setMaxOrientationOffset()

virtual bool Ocean::Tracking::VisualTracker::setMaxOrientationOffset ( const Scalar  orientationOffset)
virtual

Sets or changes the maximal expected pose orientation offset between two successive frames for this tracker.

Parameters
orientationOffsetNew orientation offset to be set in radian, with range (0, PI)
Returns
True, if succeeded

◆ setMaxPositionOffset()

virtual bool Ocean::Tracking::VisualTracker::setMaxPositionOffset ( const Vector3 positionOffset)
virtual

Sets or changes the maximal expected pose position offset between two successive frames for this tracker.

Parameters
positionOffsetNew position offset to be set for each axis separately, with range (0, infinity)
Returns
True, if succeeded

Field Documentation

◆ lock_

Lock Ocean::Tracking::VisualTracker::lock_
mutableprotected

Tracker lock object.

◆ maxOrientationOffset_

Scalar Ocean::Tracking::VisualTracker::maxOrientationOffset_ = Numeric::deg2rad(15)
protected

Maximal pose orientation offset between two frames, in radian angle.

◆ maxPositionOffset_

Vector3 Ocean::Tracking::VisualTracker::maxPositionOffset_ = Vector3(Scalar(0.08), Scalar(0.08), Scalar(0.08))
protected

Maximal pose position offset between two frames.

◆ motionModel_

MotionModel Ocean::Tracking::VisualTracker::motionModel_
protected

Pose motion model to predict the pose of the next frame.


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