struct mrpt::vision::CFeatureTracker_KL

Overview

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

#include <mrpt/vision/tracking.h>

struct CFeatureTracker_KL: public mrpt::vision::CGenericFeatureTracker
{
    // fields

    mrpt::containers::yaml extra_params;
    TExtraOutputInfo last_execution_extra_info;

    // construction

    CFeatureTracker_KL();
    CFeatureTracker_KL(const mrpt::containers::yaml& extraParams);

    // methods

    void trackFeatures(const mrpt::img::CImage& old_img, const mrpt::img::CImage& new_img, TKeyPointList& inout_featureList);
    void trackFeatures(const mrpt::img::CImage& old_img, const mrpt::img::CImage& new_img, TKeyPointfList& inout_featureList);
    const mrpt::system::CTimeLogger& getProfiler() const;
    mrpt::system::CTimeLogger& getProfiler();
    void enableTimeLogger(bool enable = true);
    int getDetectorAdaptiveThreshold() const;
};

Inherited Members

public:
    // structs

    struct TExtraOutputInfo;

Fields

mrpt::containers::yaml extra_params

Optional list of extra parameters to the algorithm.

TExtraOutputInfo last_execution_extra_info

Updated with each call to trackFeatures()

Construction

CFeatureTracker_KL()

Default ctor.

CFeatureTracker_KL(const mrpt::containers::yaml& extraParams)

Ctor with extra parameters.

Methods

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”.

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.

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

overload with subpixel precision

const mrpt::system::CTimeLogger& getProfiler() const

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

mrpt::system::CTimeLogger& getProfiler()

Returns a reference to the internal time logger.

void enableTimeLogger(bool enable = true)

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

int getDetectorAdaptiveThreshold() const

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