MRPT  1.9.9
mrpt::vision::CFeatureTracker_KL Struct Reference

Detailed Description

Track a set of features from old_img -> new_img using sparse optimal flow (classic KL method).

See CGenericFeatureTracker for a more detailed explanation on how to use this class.

List of additional parameters in "extra_params" (apart from those in CGenericFeatureTracker) accepted by this class:

  • "window_width" (Default=15)
  • "window_height" (Default=15)
  • "LK_levels" (Default=3) Number of pyramids to build for LK tracking (this parameter only has effects when tracking with CImage's, not with CImagePyramid's).
  • "LK_max_iters" (Default=10) Max. number of iterations in LK tracking.
  • "LK_epsilon" (Default=0.1) Minimum epsilon step in interations of LK_tracking.
  • "LK_max_tracking_error" (Default=150.0) The maximum "tracking error" of LK tracking such as a feature is marked as "lost".
See also
OpenCV's method cvCalcOpticalFlowPyrLK

Definition at line 282 of file tracking.h.

#include <mrpt/vision/tracking.h>

Inheritance diagram for mrpt::vision::CFeatureTracker_KL:

Public Member Functions

 CFeatureTracker_KL ()=default
 Default ctor. More...
 
 CFeatureTracker_KL (mrpt::system::TParametersDouble extraParams)
 Ctor with extra parameters. More...
 
void trackFeatures (const mrpt::img::CImage &old_img, const mrpt::img::CImage &new_img, TKeyPointList &inout_featureList)
 Perform feature tracking from "old_img" to "new_img", with a (possibly empty) list of previously tracked features "inout_featureList". More...
 
void trackFeatures (const mrpt::img::CImage &old_img, const mrpt::img::CImage &new_img, TKeyPointfList &inout_featureList)
 overload with subpixel precision More...
 
const mrpt::system::CTimeLoggergetProfiler () const
 Returns a read-only reference to the internal time logger. More...
 
mrpt::system::CTimeLoggergetProfiler ()
 Returns a reference to the internal time logger. More...
 
void enableTimeLogger (bool enable=true)
 Returns a read-only reference to the internal time logger. More...
 
int getDetectorAdaptiveThreshold () const
 Returns the current adaptive threshold used by the FAST(ER) detector to find out new features in empty areas. More...
 

Public Attributes

mrpt::system::TParametersDouble extra_params
 Optional list of extra parameters to the algorithm. More...
 
TExtraOutputInfo last_execution_extra_info
 Updated with each call to trackFeatures() More...
 

Protected Member Functions

void trackFeatures_impl (const mrpt::img::CImage &old_img, const mrpt::img::CImage &new_img, TKeyPointList &inout_featureList) override
 The tracking method implementation, to be implemented in children classes. More...
 
void trackFeatures_impl (const mrpt::img::CImage &old_img, const mrpt::img::CImage &new_img, TKeyPointfList &inout_featureList) override
 The tracking method implementation, to be implemented in children classes. More...
 
void updateAdaptiveNewFeatsThreshold (const size_t nNewlyDetectedFeats, const size_t desired_num_features)
 Adapts the threshold m_detector_adaptive_thres according to the real and desired number of features just detected. More...
 

Protected Attributes

mrpt::system::CTimeLogger m_timlog
 the internal time logger, disabled by default. More...
 
mrpt::vision::TKeyPointList m_newly_detected_feats
 This field is clared by trackFeatures() before calling trackFeatures_impl(), and can be filled out with newly defected FAST(ER) features in the latter. More...
 

Private Member Functions

template<typename FEATLIST >
void trackFeatures_impl_templ (const mrpt::img::CImage &old_img, const mrpt::img::CImage &new_img, FEATLIST &inout_featureList)
 Track a set of features from old_img -> new_img using sparse optimal flow (classic KL method) Optional parameters that can be passed in "extra_params": More...
 

Constructor & Destructor Documentation

◆ CFeatureTracker_KL() [1/2]

mrpt::vision::CFeatureTracker_KL::CFeatureTracker_KL ( )
inlinedefault

Default ctor.

◆ CFeatureTracker_KL() [2/2]

mrpt::vision::CFeatureTracker_KL::CFeatureTracker_KL ( mrpt::system::TParametersDouble  extraParams)
inline

Ctor with extra parameters.

Definition at line 287 of file tracking.h.

Member Function Documentation

◆ enableTimeLogger()

void mrpt::vision::CGenericFeatureTracker::enableTimeLogger ( bool  enable = true)
inlineinherited

Returns a read-only reference to the internal time logger.

Definition at line 190 of file tracking.h.

References mrpt::system::CTimeLogger::enable(), and mrpt::vision::CGenericFeatureTracker::m_timlog.

Here is the call graph for this function:

◆ getDetectorAdaptiveThreshold()

int mrpt::vision::CGenericFeatureTracker::getDetectorAdaptiveThreshold ( ) const
inlineinherited

Returns the current adaptive threshold used by the FAST(ER) detector to find out new features in empty areas.

Definition at line 197 of file tracking.h.

References mrpt::vision::CGenericFeatureTracker::m_detector_adaptive_thres.

◆ getProfiler() [1/2]

const mrpt::system::CTimeLogger& mrpt::vision::CGenericFeatureTracker::getProfiler ( ) const
inlineinherited

Returns a read-only reference to the internal time logger.

Definition at line 183 of file tracking.h.

References mrpt::vision::CGenericFeatureTracker::m_timlog.

◆ getProfiler() [2/2]

mrpt::system::CTimeLogger& mrpt::vision::CGenericFeatureTracker::getProfiler ( )
inlineinherited

Returns a reference to the internal time logger.

Definition at line 188 of file tracking.h.

References mrpt::vision::CGenericFeatureTracker::m_timlog.

◆ trackFeatures() [1/2]

void CGenericFeatureTracker::trackFeatures ( const mrpt::img::CImage old_img,
const mrpt::img::CImage new_img,
TKeyPointList inout_featureList 
)
inherited

Perform feature tracking from "old_img" to "new_img", with a (possibly empty) list of previously tracked features "inout_featureList".

This is a list of parameters (in "extraParams") accepted by ALL implementations of feature tracker (see each derived class for more specific parameters).

  • "add_new_features" (Default=0). If set to "1", new features will be also added to the existing ones in areas of the image poor of features. This method does:

Convert old and new images to grayscale, if they're in color.

  • Call the pure virtual "trackFeatures_impl" method.
  • Implement the optional detection of new features if "add_new_features"!=0.

Definition at line 662 of file tracking.cpp.

◆ trackFeatures() [2/2]

void CGenericFeatureTracker::trackFeatures ( const mrpt::img::CImage old_img,
const mrpt::img::CImage new_img,
TKeyPointfList inout_featureList 
)
inherited

overload with subpixel precision

Definition at line 668 of file tracking.cpp.

◆ trackFeatures_impl() [1/2]

void CFeatureTracker_KL::trackFeatures_impl ( const mrpt::img::CImage old_img,
const mrpt::img::CImage new_img,
TKeyPointList inout_featureList 
)
overrideprotectedvirtual

The tracking method implementation, to be implemented in children classes.

Implements mrpt::vision::CGenericFeatureTracker.

Definition at line 124 of file tracking_KL.cpp.

◆ trackFeatures_impl() [2/2]

void CFeatureTracker_KL::trackFeatures_impl ( const mrpt::img::CImage old_img,
const mrpt::img::CImage new_img,
TKeyPointfList inout_featureList 
)
overrideprotectedvirtual

The tracking method implementation, to be implemented in children classes.

Reimplemented from mrpt::vision::CGenericFeatureTracker.

Definition at line 130 of file tracking_KL.cpp.

◆ trackFeatures_impl_templ()

template<typename FEATLIST >
void CFeatureTracker_KL::trackFeatures_impl_templ ( const mrpt::img::CImage old_img,
const mrpt::img::CImage new_img,
FEATLIST &  featureList 
)
private

Track a set of features from old_img -> new_img using sparse optimal flow (classic KL method) Optional parameters that can be passed in "extra_params":

  • "window_width" (Default=15)
  • "window_height" (Default=15)
See also
OpenCV's method cvCalcOpticalFlowPyrLK

Definition at line 37 of file tracking_KL.cpp.

References mrpt::img::CImage::asCvMatRef(), ASSERT_, mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), MRPT_END, MRPT_START, status, mrpt::vision::status_LOST, mrpt::vision::status_OOB, mrpt::vision::status_TRACKED, and THROW_EXCEPTION.

Here is the call graph for this function:

◆ updateAdaptiveNewFeatsThreshold()

void CGenericFeatureTracker::updateAdaptiveNewFeatsThreshold ( const size_t  nNewlyDetectedFeats,
const size_t  desired_num_features 
)
protectedinherited

Adapts the threshold m_detector_adaptive_thres according to the real and desired number of features just detected.

Definition at line 674 of file tracking.cpp.

References min.

Member Data Documentation

◆ extra_params

mrpt::system::TParametersDouble mrpt::vision::CGenericFeatureTracker::extra_params
inherited

Optional list of extra parameters to the algorithm.

Definition at line 144 of file tracking.h.

◆ last_execution_extra_info

TExtraOutputInfo mrpt::vision::CGenericFeatureTracker::last_execution_extra_info
inherited

Updated with each call to trackFeatures()

Definition at line 212 of file tracking.h.

◆ m_newly_detected_feats

mrpt::vision::TKeyPointList mrpt::vision::CGenericFeatureTracker::m_newly_detected_feats
protectedinherited

This field is clared by trackFeatures() before calling trackFeatures_impl(), and can be filled out with newly defected FAST(ER) features in the latter.

If it's not the case, feats will be computed anyway if the user enabled the "add_new_features" option.

Definition at line 236 of file tracking.h.

◆ m_timlog

mrpt::system::CTimeLogger mrpt::vision::CGenericFeatureTracker::m_timlog
protectedinherited

the internal time logger, disabled by default.

Definition at line 228 of file tracking.h.

Referenced by mrpt::vision::CGenericFeatureTracker::enableTimeLogger(), and mrpt::vision::CGenericFeatureTracker::getProfiler().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019