Ocean
Ocean::Tracking::Offline::PointPaths Class Reference

This class implements point path tracker allowing to track image points from frame to frame within a stream of several successive frames. More...

Data Structures

class  TrackingConfiguration
 Definition of a class holding a point tracking configuration. More...
 

Public Types

enum  MotionSpeed { MS_SLOW , MS_MODERATE , MS_FAST }
 Definition of individual camera motion speeds. More...
 
enum  TrackingMethod { TM_INVALID , TM_FIXED_PATCH_SIZE_7 , TM_FIXED_PATCH_SIZE_15 , TM_FIXED_PATCH_SIZE_31 }
 Definition of individual tracking methods. More...
 

Static Public Member Functions

static bool determinePointPaths (CV::FrameProviderInterface &frameProviderInterface, const FrameType::PixelFormat pixelFormat, const FrameType::PixelOrigin pixelOrigin, const TrackingConfiguration &trackingConfiguration, const unsigned int lowerFrameIndex, const unsigned int startFrameIndex, const unsigned int upperFrameIndex, const unsigned int invalidBorderSize, const bool onlyNewObjectPoints, Database &database, Worker *worker=nullptr, bool *abort=nullptr, Scalar *progress=nullptr)
 Tracks reliable points between successive frames and joins points paths to a common/shared object points. More...
 
static bool determinePointPaths (CV::FrameProviderInterface &frameProviderInterface, const FrameType::PixelFormat pixelFormat, const FrameType::PixelOrigin pixelOrigin, const TrackingConfiguration &trackingConfiguration, const unsigned int lowerFrameIndex, const CV::SubRegion &subRegion, const unsigned int subRegionFrameIndex, const unsigned int upperFrameIndex, const unsigned int invalidBorderSize, const bool onlyNewObjectPoints, Database &database, Worker *worker=nullptr, bool *abort=nullptr, Scalar *progress=nullptr)
 Tracks reliable points between successive frames starting at a specific frame in a specific sub-region. More...
 
static bool determineTrackingConfiguration (CV::FrameProviderInterface &frameProviderInterface, const CV::SubRegion &regionOfInterest, const OfflineTracker::TrackingQuality trackingQuality, const MotionSpeed motionSpeed, TrackingConfiguration *frameTrackingConfiguration, TrackingConfiguration *regionOfInterestTrackingConfiguration, bool *abort=nullptr)
 Determines the tracking configuration for an explicit specified tracking quality. More...
 
static bool determineAutomaticTrackingConfiguration (CV::FrameProviderInterface &frameProviderInterface, const FrameType::PixelOrigin pixelOrigin, const MotionSpeed motionSpeed, const unsigned int frameIndex, const CV::SubRegion &regionOfInterest, TrackingConfiguration *frameTrackingConfiguration, TrackingConfiguration *regionOfInterestTrackingConfiguration, Worker *worker=nullptr, bool *abort=nullptr)
 Determines the best matching tracking configuration for the point tracker starting at a specific frame. More...
 
static bool determineAutomaticTrackingConfiguration (CV::FrameProviderInterface &frameProviderInterface, const FrameType::PixelOrigin pixelOrigin, const MotionSpeed motionSpeed, const unsigned int lowerFrameIndex, const unsigned int upperFrameIndex, TrackingConfiguration &frameTrackingConfiguration, const unsigned int intermediateFrames=5u, Worker *worker=nullptr, bool *abort=nullptr)
 Determines the best matching tracking configuration for the point tracker tracking frames within a specified frame range. More...
 
static void idealPyramidParameters (const unsigned int width, const unsigned int height, const MotionSpeed motionSpeed, unsigned int &coarsestLayerRadius, unsigned int &layers, const unsigned int maximalCoarsestLayerRadius=26u, const unsigned int maximalLayers=(unsigned int)(-1))
 Determines the number of necessary pyramid layers and coarsest layer radius for a specified frame dimension and motion speed. More...
 

Protected Types

using TrackingConfigurationPair = std::pair< TrackingConfiguration, unsigned int >
 Definition of a pair combining a tracker configuration and a ratio value. More...
 
using TrackingConfigurationPairs = std::vector< TrackingConfigurationPair >
 Definition of a vector holding TrackingConfigurationPair objects. More...
 
using Strengths = std::vector< int >
 Definition of a vector holding strength parameters. More...
 

Static Protected Member Functions

static bool trackPoints (const CV::FramePyramid &previousFramePyramid, const CV::FramePyramid &currentFramePyramid, const unsigned int coarsestLayerRadius, const Strengths &previousFeatureStrengths, const TrackingMethod trackingMethod, Vectors2 &previousFeaturePoints, Vectors2 &currentFeaturePoints, Indices32 &validIndices, Worker *worker)
 Applies a bidirectional tracking of points between to frames. More...
 

Detailed Description

This class implements point path tracker allowing to track image points from frame to frame within a stream of several successive frames.

Member Typedef Documentation

◆ Strengths

using Ocean::Tracking::Offline::PointPaths::Strengths = std::vector<int>
protected

Definition of a vector holding strength parameters.

◆ TrackingConfigurationPair

Definition of a pair combining a tracker configuration and a ratio value.

◆ TrackingConfigurationPairs

Definition of a vector holding TrackingConfigurationPair objects.

Member Enumeration Documentation

◆ MotionSpeed

Definition of individual camera motion speeds.

Enumerator
MS_SLOW 

A slow motion of the camera.

MS_MODERATE 

A moderate motion of the camera.

MS_FAST 

A fast motion of the camera.

◆ TrackingMethod

Definition of individual tracking methods.

Enumerator
TM_INVALID 

Invalid tracking method.

TM_FIXED_PATCH_SIZE_7 

Using a patch with size 7.

TM_FIXED_PATCH_SIZE_15 

Using a patch with size 15.

TM_FIXED_PATCH_SIZE_31 

Using a patch with size 31.

Member Function Documentation

◆ determineAutomaticTrackingConfiguration() [1/2]

static bool Ocean::Tracking::Offline::PointPaths::determineAutomaticTrackingConfiguration ( CV::FrameProviderInterface frameProviderInterface,
const FrameType::PixelOrigin  pixelOrigin,
const MotionSpeed  motionSpeed,
const unsigned int  frameIndex,
const CV::SubRegion regionOfInterest,
TrackingConfiguration frameTrackingConfiguration,
TrackingConfiguration regionOfInterestTrackingConfiguration,
Worker worker = nullptr,
bool *  abort = nullptr 
)
static

Determines the best matching tracking configuration for the point tracker starting at a specific frame.

The most suitable configuration can either be determined for the entire frame, for a specified region of interest or for both areas.

Parameters
frameProviderInterfaceThe frame provider interface providing the frame access
pixelOriginThe origin of the frame for which the configuration will be determined
motionSpeedThe expected motion speed of the image content
frameIndexThe index of the frame for which the configuration will be determined
regionOfInterestThe optional region of interest for which the specific region-of-interest-configuration may be determined, an invalid region otherwise
frameTrackingConfigurationThe resulting tracking configuration for the entire frame, if defined
regionOfInterestTrackingConfigurationThe resulting tracking configuration for the specified region of interest, if defined and if a region of interest is defined
workerOptional worker object to distribute the computation
abortOptional abort statement allowing to stop the execution; True, if the execution has to stop
Returns
True, if succeeded

◆ determineAutomaticTrackingConfiguration() [2/2]

static bool Ocean::Tracking::Offline::PointPaths::determineAutomaticTrackingConfiguration ( CV::FrameProviderInterface frameProviderInterface,
const FrameType::PixelOrigin  pixelOrigin,
const MotionSpeed  motionSpeed,
const unsigned int  lowerFrameIndex,
const unsigned int  upperFrameIndex,
TrackingConfiguration frameTrackingConfiguration,
const unsigned int  intermediateFrames = 5u,
Worker worker = nullptr,
bool *  abort = nullptr 
)
static

Determines the best matching tracking configuration for the point tracker tracking frames within a specified frame range.

Parameters
frameProviderInterfaceThe frame provider interface providing the frame access
pixelOriginThe origin of the frame for which the configuration will be determined
motionSpeedThe expected motion speed of the image content
lowerFrameIndexThe index of the frame defining the lower frame range, with range [0, infinity)
upperFrameIndexThe index of the frame defining the upper frame range, with range [lowerFrameIndex, infinity)
frameTrackingConfigurationThe resulting tracking configuration for the entire frame
intermediateFramesThe number of intermediate frames which will be distributed within the specified frame range to determine the best matching configuration
workerOptional worker object to distribute the computation
abortOptional abort statement allowing to stop the execution; True, if the execution has to stop
Returns
True, if succeeded

◆ determinePointPaths() [1/2]

static bool Ocean::Tracking::Offline::PointPaths::determinePointPaths ( CV::FrameProviderInterface frameProviderInterface,
const FrameType::PixelFormat  pixelFormat,
const FrameType::PixelOrigin  pixelOrigin,
const TrackingConfiguration trackingConfiguration,
const unsigned int  lowerFrameIndex,
const CV::SubRegion subRegion,
const unsigned int  subRegionFrameIndex,
const unsigned int  upperFrameIndex,
const unsigned int  invalidBorderSize,
const bool  onlyNewObjectPoints,
Database database,
Worker worker = nullptr,
bool *  abort = nullptr,
Scalar progress = nullptr 
)
static

Tracks reliable points between successive frames starting at a specific frame in a specific sub-region.

Successive tracked points will be joined to a path representing the same object point.

Parameters
frameProviderInterfaceThe frame provider interface which is used to extract the individual frames, must be valid and must be initialized
pixelFormatThe pixel format which is used for each frame
pixelOriginThe pixel origin which is used for each frame
trackingConfigurationThe tracking configuration that is applied to track the points
lowerFrameIndexThe index of the lower frame which will be used for tracking
subRegionThe sub-region defining a specific frame area in the start frame in which all reliable points will be tracked
subRegionFrameIndexThe index of the frame in which the sub-region is defined
upperFrameIndexThe index of the upper frame which will be used for tracking, with range [lowerFrame, infinity)
invalidBorderSizeThe border size at the outer frame border in which tracked points will count as invalid, in pixel, with range [0, min(width / 2, height / 2))
onlyNewObjectPointsTrue, to add and track only object points which are not part of the database yet
databaseThe resulting database holding the object points, image points and camera poses after tracking, must be empty
workerOptional worker object to distribute the computation
abortOptional abort statement allowing to stop the execution; True, if the execution has to stop
progressOptional resulting progress with range [0, 1]
Returns
True, if succeeded

◆ determinePointPaths() [2/2]

static bool Ocean::Tracking::Offline::PointPaths::determinePointPaths ( CV::FrameProviderInterface frameProviderInterface,
const FrameType::PixelFormat  pixelFormat,
const FrameType::PixelOrigin  pixelOrigin,
const TrackingConfiguration trackingConfiguration,
const unsigned int  lowerFrameIndex,
const unsigned int  startFrameIndex,
const unsigned int  upperFrameIndex,
const unsigned int  invalidBorderSize,
const bool  onlyNewObjectPoints,
Database database,
Worker worker = nullptr,
bool *  abort = nullptr,
Scalar progress = nullptr 
)
static

Tracks reliable points between successive frames and joins points paths to a common/shared object points.

Further, camera poses are registered for each camera frame (without the actual pose determination).

Parameters
frameProviderInterfaceThe frame provider interface which is used to extract the individual frames, must be valid and must be initialized
pixelFormatThe pixel format which is used for each frame
pixelOriginThe pixel origin which is used for each frame
trackingConfigurationThe tracking configuration that is applied to track the points
lowerFrameIndexThe index of the lower frame which will be used for tracking
startFrameIndexThe index of the frame at which the determination of the point paths will start, with range [lowerFrameIndex, upperFrameIndex]
upperFrameIndexThe index of the upper frame which will be used for tracking, with range [lowerFrame, infinity)
invalidBorderSizeThe border size at the outer frame border in which tracked points will count as invalid, in pixel, with range [0, min(width / 2, height / 2))
onlyNewObjectPointsTrue, to add and track only object points which are not part of the database yet
databaseThe resulting database holding the object points, image points and camera poses after tracking, must be empty
workerOptional worker object to distribute the computation
abortOptional abort statement allowing to stop the execution; True, if the execution has to stop
progressOptional resulting progress with range [0, 1]
Returns
True, if succeeded

◆ determineTrackingConfiguration()

static bool Ocean::Tracking::Offline::PointPaths::determineTrackingConfiguration ( CV::FrameProviderInterface frameProviderInterface,
const CV::SubRegion regionOfInterest,
const OfflineTracker::TrackingQuality  trackingQuality,
const MotionSpeed  motionSpeed,
TrackingConfiguration frameTrackingConfiguration,
TrackingConfiguration regionOfInterestTrackingConfiguration,
bool *  abort = nullptr 
)
static

Determines the tracking configuration for an explicit specified tracking quality.

Parameters
frameProviderInterfaceThe frame provider interface providing the frame access
regionOfInterestThe optional region of interest for which the specific region-of-interest-configuration may be determined, an invalid region otherwise
trackingQualityThe tracking quality for which the tracking configuration will be determined
motionSpeedThe expected motion speed of the image content
frameTrackingConfigurationThe resulting tracking configuration for the entire frame, if defined
regionOfInterestTrackingConfigurationThe resulting tracking configuration for the specified region of interest, if defined and if a region of interest is defined
abortOptional abort statement allowing to stop the execution; True, if the execution has to stop
Returns
True, if succeeded

◆ idealPyramidParameters()

static void Ocean::Tracking::Offline::PointPaths::idealPyramidParameters ( const unsigned int  width,
const unsigned int  height,
const MotionSpeed  motionSpeed,
unsigned int &  coarsestLayerRadius,
unsigned int &  layers,
const unsigned int  maximalCoarsestLayerRadius = 26u,
const unsigned int  maximalLayers = (unsigned int)(-1) 
)
static

Determines the number of necessary pyramid layers and coarsest layer radius for a specified frame dimension and motion speed.

Parameters
widthThe width of the frame (the width of the finest pyramid layer) in pixel, with range [1, infinity)
heightThe height of the frame (the height of the finest pyramid layer) in pixel, with range [1, infinity)
motionSpeedThe motion speed for which the minimal number of pyramid layers will be determined
coarsestLayerRadiusResulting search radius for the coarsest pyramid layer, with range [2, infinity)
layersResulting number of pyramid layers necessary for the defined parameters, with range [3, infinity)
maximalCoarsestLayerRadiusThe maximal (largest) search radius on the coarsest pyramid layers which can be accepted, with range [2, infinity)
maximalLayersThe maximal number of pyramid layers which can be accepted, with range [1, infinity)

◆ trackPoints()

static bool Ocean::Tracking::Offline::PointPaths::trackPoints ( const CV::FramePyramid previousFramePyramid,
const CV::FramePyramid currentFramePyramid,
const unsigned int  coarsestLayerRadius,
const Strengths previousFeatureStrengths,
const TrackingMethod  trackingMethod,
Vectors2 previousFeaturePoints,
Vectors2 currentFeaturePoints,
Indices32 validIndices,
Worker worker 
)
staticprotected

Applies a bidirectional tracking of points between to frames.

Parameters
previousFramePyramidThe frame pyramid of the previous frame, must be valid
currentFramePyramidThe frame pyramid of the current frame, must be valid and must have the same number of layers as 'previousFramePyramid'
coarsestLayerRadiusThe search radius on the coarsest layer, with range [2, infinity)
previousFeatureStrengthsThe strength values for each individual previous image point
trackingMethodThe tracking method to be used to track the points
previousFeaturePointsThe image points located in the previous frame
currentFeaturePointsThe resulting tracked image points located in the current frame
validIndicesThe indices of all image points that could be tracked reliably
workerOptional worker object to distribute the computation
Returns
True, if succeeded

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