Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches

#include <vpRBKltTracker.h>

Inheritance diagram for vpRBKltTracker:

Classes

struct  vpTrackedKltPoint

Public Member Functions

 vpRBKltTracker ()
virtual ~vpRBKltTracker ()=default
bool requiresRGB () const VP_OVERRIDE
bool requiresDepth () const VP_OVERRIDE
bool requiresSilhouetteCandidates () const VP_OVERRIDE
void onTrackingIterStart (const vpRBFeatureTrackerInput &, const vpHomogeneousMatrix &) VP_OVERRIDE
void onTrackingIterEnd (const vpHomogeneousMatrix &) VP_OVERRIDE
void extractFeatures (const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
void trackFeatures (const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
void initVVS (const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
void computeVVSIter (const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo, unsigned int iteration) VP_OVERRIDE
void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpImage< vpRGBa > &IRGB, const vpImage< unsigned char > &depth) const VP_OVERRIDE
unsigned getNumFeatures () const
bool vvsHasConverged () const
virtual double getVVSTrackerWeight (double optimizationProgress) const
const std::shared_ptr< vpTemporalWeightinggetTemporalTrackerWeight () const
void setTrackerWeight (double weight)
void setTrackerWeight (const std::shared_ptr< vpTemporalWeighting > &weight)
virtual vpMatrix getLTL () const
virtual vpColVector getLTR () const
const vpColVectorgetWeightedError () const
void setComputeJacobianObjectSpace (bool inObjectSpace)
bool hasIgnoredDofs () const
void setEstimatedDofs (const std::array< bool, 6 > &dofs)
void updateOptimizerTerms (const vpHomogeneousMatrix &cMo)
Settings
unsigned int getMinimumNumberOfPoints () const
void setMinimumNumberOfPoints (unsigned int points)
double getMinimumDistanceNewPoints () const
void setMinimumDistanceNewPoints (double distance)
unsigned int getFilteringBorderSize () const
void setFilteringBorderSize (unsigned int border)
double getFilteringMaxReprojectionError () const
void setFilteringMaxReprojectionError (double maxError)
bool shouldUseMask () const
void setShouldUseMask (bool useMask)
float getMinimumMaskConfidence () const
void setMinimumMaskConfidence (float confidence)
const vpKltOpencvgetKltTracker () const
vpKltOpencvgetKltTracker ()
virtual void loadJsonConfiguration (const nlohmann::json &j) VP_OVERRIDE
Core Tracking methods
virtual void reset ()
Display
bool featuresShouldBeDisplayed () const
void setFeaturesShouldBeDisplayed (bool enableDisplay)
Covariance computation
virtual const vpMatrix getCovariance () const
virtual void updateCovariance (const double lambda)

Static Public Member Functions

static void computeJTR (const vpMatrix &interaction, const vpColVector &error, vpColVector &JTR)
static vpMatrix computeCovarianceMatrix (const vpMatrix &A, const vpColVector &b, const vpMatrix &W)

Protected Member Functions

vpMatrix computeoJo () const

Protected Attributes

vpMatrix m_L
vpMatrix m_LTL
vpColVector m_LTR
vpMatrix m_cov
vpColVector m_covWeightDiag
vpColVector m_error
vpColVector m_weighted_error
vpColVector m_weights
unsigned m_numFeatures
std::shared_ptr< vpTemporalWeightingm_weighting
bool m_vvsConverged
bool m_enableDisplay
std::array< bool, 6 > m_estimatedDofs
vpMatrix m_oJo
bool m_jacobianInObjectSpace

Detailed Description

KLT-Based features.

Tutorials & Examples

Tutorials
If you want to have an in-depth presentation of the Render-Based Tracker (RBT), you may have a look at:

Examples
catchRBT.cpp.

Definition at line 71 of file vpRBKltTracker.h.

Constructor & Destructor Documentation

◆ vpRBKltTracker()

vpRBKltTracker::vpRBKltTracker ( )

◆ ~vpRBKltTracker()

virtual vpRBKltTracker::~vpRBKltTracker ( )
virtualdefault

Member Function Documentation

◆ computeCovarianceMatrix()

vpMatrix vpRBFeatureTracker::computeCovarianceMatrix ( const vpMatrix & A,
const vpColVector & b,
const vpMatrix & W )
staticinherited

Definition at line 78 of file vpRBFeatureTracker.cpp.

References vpColVector::t(), and vpMatrix::t().

Referenced by updateCovariance().

◆ computeJTR()

void vpRBFeatureTracker::computeJTR ( const vpMatrix & interaction,
const vpColVector & error,
vpColVector & JTR )
staticinherited

◆ computeoJo()

vpMatrix vpRBFeatureTracker::computeoJo ( ) const
inlineprotectedinherited

Definition at line 284 of file vpRBFeatureTracker.h.

References m_estimatedDofs.

Referenced by setEstimatedDofs().

◆ computeVVSIter()

void vpRBKltTracker::computeVVSIter ( const vpRBFeatureTrackerInput & frame,
const vpHomogeneousMatrix & cMo,
unsigned int iteration )
virtual

Implements vpRBFeatureTracker.

◆ display()

void vpRBKltTracker::display ( const vpCameraParameters & cam,
const vpImage< unsigned char > & I,
const vpImage< vpRGBa > & IRGB,
const vpImage< unsigned char > & depth ) const
virtual

Implements vpRBFeatureTracker.

◆ extractFeatures()

void vpRBKltTracker::extractFeatures ( const vpRBFeatureTrackerInput & frame,
const vpRBFeatureTrackerInput & previousFrame,
const vpHomogeneousMatrix & cMo )
virtual

Extract features from the frame data and the current pose estimate.

Implements vpRBFeatureTracker.

◆ featuresShouldBeDisplayed()

bool vpRBFeatureTracker::featuresShouldBeDisplayed ( ) const
inlineinherited

Definition at line 163 of file vpRBFeatureTracker.h.

References m_enableDisplay.

◆ getCovariance()

virtual const vpMatrix vpRBFeatureTracker::getCovariance ( ) const
inlinevirtualinherited

Retrieve the 6 x 6 pose covariance matrix, computed from the weights associated to each feature.

The updateCovariance method should have been called before

Definition at line 186 of file vpRBFeatureTracker.h.

References m_cov.

◆ getFilteringBorderSize()

unsigned int vpRBKltTracker::getFilteringBorderSize ( ) const
inline

Return the number of pixels in the image border where points should not be tracked. Points that are near image borders are likely to be lost in the future.

Definition at line 125 of file vpRBKltTracker.h.

◆ getFilteringMaxReprojectionError()

double vpRBKltTracker::getFilteringMaxReprojectionError ( ) const
inline

Get the maximum reprojection error, in pixels, for a point to be considered as outlier. This reprojection error is computed between the tracked klt position in the image and the reprojection of the associated 3D point. If a point goes above this threshold, it is removed from tracking.

Returns
double

Definition at line 135 of file vpRBKltTracker.h.

◆ getKltTracker() [1/2]

vpKltOpencv & vpRBKltTracker::getKltTracker ( )
inline

Get the underlying KLT tracker. Use this to modify its settings.

Warning
Only modify its tracking settings, not its state.

Definition at line 169 of file vpRBKltTracker.h.

◆ getKltTracker() [2/2]

const vpKltOpencv & vpRBKltTracker::getKltTracker ( ) const
inline

Get the underlying KLT tracker. Use this to read its settings.

Definition at line 163 of file vpRBKltTracker.h.

◆ getLTL()

virtual vpMatrix vpRBFeatureTracker::getLTL ( ) const
inlinevirtualinherited

Get the left-side term of the Gauss-Newton optimization term.

Definition at line 215 of file vpRBFeatureTracker.h.

References m_LTL.

◆ getLTR()

virtual vpColVector vpRBFeatureTracker::getLTR ( ) const
inlinevirtualinherited

Get the right-side term of the Gauss-Newton optimization term.

Definition at line 220 of file vpRBFeatureTracker.h.

References m_LTR.

◆ getMinimumDistanceNewPoints()

double vpRBKltTracker::getMinimumDistanceNewPoints ( ) const
inline

Get the minimum distance that a candidate point should have to every other tracked point if it should be added.

During tracking, KLT points are frequently sampled. This settings used to ensure that multiple klt points do not track the same 3D points.

Definition at line 118 of file vpRBKltTracker.h.

◆ getMinimumMaskConfidence()

float vpRBKltTracker::getMinimumMaskConfidence ( ) const
inline

Returns the minimum mask confidence that a pixel should have if it should be kept during tracking.

This value is between 0 and 1

Definition at line 151 of file vpRBKltTracker.h.

◆ getMinimumNumberOfPoints()

unsigned int vpRBKltTracker::getMinimumNumberOfPoints ( ) const
inline

Get the minimum acceptable number of points that should be tracked. If KLT tracking has less than this number of points. The KLT tracking will be fully reinitialized.

Definition at line 108 of file vpRBKltTracker.h.

◆ getNumFeatures()

unsigned vpRBFeatureTracker::getNumFeatures ( ) const
inlineinherited

Return the type of feature that is used by this tracker.

Returns
vpRBFeatureType

Get the number of features used to compute the pose update

Definition at line 88 of file vpRBFeatureTracker.h.

References m_numFeatures.

◆ getTemporalTrackerWeight()

const std::shared_ptr< vpTemporalWeighting > vpRBFeatureTracker::getTemporalTrackerWeight ( ) const
inlineinherited

Definition at line 208 of file vpRBFeatureTracker.h.

References m_weighting.

◆ getVVSTrackerWeight()

virtual double vpRBFeatureTracker::getVVSTrackerWeight ( double optimizationProgress) const
inlinevirtualinherited

Get the importance of this tracker in the optimization step. The default computation is the following: $ w / N $, where $ w$ is the weight defined by setTrackerWeight, and $ N $ is the number of features.

Reimplemented in vpRBSilhouetteCCDTracker.

Definition at line 207 of file vpRBFeatureTracker.h.

References m_numFeatures, and m_weighting.

◆ getWeightedError()

const vpColVector & vpRBFeatureTracker::getWeightedError ( ) const
inlineinherited

Get a weighted version of the error vector. This should not include the userVVSWeight, but may include reweighting to remove outliers, occlusions, etc.

Definition at line 226 of file vpRBFeatureTracker.h.

References m_weighted_error.

◆ hasIgnoredDofs()

bool vpRBFeatureTracker::hasIgnoredDofs ( ) const
inlineinherited

◆ initVVS()

void vpRBKltTracker::initVVS ( const vpRBFeatureTrackerInput & frame,
const vpRBFeatureTrackerInput & previousFrame,
const vpHomogeneousMatrix & cMo )
virtual

Implements vpRBFeatureTracker.

◆ loadJsonConfiguration()

virtual void vpRBKltTracker::loadJsonConfiguration ( const nlohmann::json & j)
inlinevirtual

◆ onTrackingIterEnd()

void vpRBKltTracker::onTrackingIterEnd ( const vpHomogeneousMatrix & cMo)
inlinevirtual

Method called after the tracking iteration has finished.

Implements vpRBFeatureTracker.

Definition at line 86 of file vpRBKltTracker.h.

◆ onTrackingIterStart()

void vpRBKltTracker::onTrackingIterStart ( const vpRBFeatureTrackerInput & frame,
const vpHomogeneousMatrix & cMo )
inlinevirtual

Method called when starting a tracking iteration.

Implements vpRBFeatureTracker.

Definition at line 84 of file vpRBKltTracker.h.

◆ requiresDepth()

bool vpRBKltTracker::requiresDepth ( ) const
inlinevirtual

Whether this tracker requires depth image to extract features.

Implements vpRBFeatureTracker.

Definition at line 80 of file vpRBKltTracker.h.

◆ requiresRGB()

bool vpRBKltTracker::requiresRGB ( ) const
inlinevirtual

Whether this tracker requires RGB image to extract features.

Returns
true if the tracker requires an RGB image
false otherwise

Implements vpRBFeatureTracker.

Definition at line 78 of file vpRBKltTracker.h.

◆ requiresSilhouetteCandidates()

bool vpRBKltTracker::requiresSilhouetteCandidates ( ) const
inlinevirtual

Whether this tracker requires Silhouette candidates.

Implements vpRBFeatureTracker.

Definition at line 82 of file vpRBKltTracker.h.

◆ reset()

virtual void vpRBFeatureTracker::reset ( )
inlinevirtualinherited

Resets feature state. Can be called when the object changes or is lost, Ensuring that prior data does not influence the tracking behaviour.

Reimplemented in vpRBSilhouetteCCDTracker.

Definition at line 152 of file vpRBFeatureTracker.h.

◆ setComputeJacobianObjectSpace()

void vpRBFeatureTracker::setComputeJacobianObjectSpace ( bool inObjectSpace)
inlineinherited

Definition at line 238 of file vpRBFeatureTracker.h.

References m_jacobianInObjectSpace.

◆ setEstimatedDofs()

void vpRBFeatureTracker::setEstimatedDofs ( const std::array< bool, 6 > & dofs)
inlineinherited

Definition at line 255 of file vpRBFeatureTracker.h.

References computeoJo(), m_estimatedDofs, and m_oJo.

Referenced by loadJsonConfiguration(), and vpRBFeatureTracker().

◆ setFeaturesShouldBeDisplayed()

void vpRBFeatureTracker::setFeaturesShouldBeDisplayed ( bool enableDisplay)
inlineinherited

◆ setFilteringBorderSize()

void vpRBKltTracker::setFilteringBorderSize ( unsigned int border)
inline

Definition at line 126 of file vpRBKltTracker.h.

◆ setFilteringMaxReprojectionError()

void vpRBKltTracker::setFilteringMaxReprojectionError ( double maxError)
inline

Definition at line 136 of file vpRBKltTracker.h.

Referenced by loadJsonConfiguration().

◆ setMinimumDistanceNewPoints()

void vpRBKltTracker::setMinimumDistanceNewPoints ( double distance)
inline

Definition at line 119 of file vpRBKltTracker.h.

Referenced by loadJsonConfiguration().

◆ setMinimumMaskConfidence()

void vpRBKltTracker::setMinimumMaskConfidence ( float confidence)
inline

Definition at line 152 of file vpRBKltTracker.h.

References vpException::badValue.

Referenced by loadJsonConfiguration().

◆ setMinimumNumberOfPoints()

void vpRBKltTracker::setMinimumNumberOfPoints ( unsigned int points)
inline

Definition at line 109 of file vpRBKltTracker.h.

Referenced by loadJsonConfiguration().

◆ setShouldUseMask()

void vpRBKltTracker::setShouldUseMask ( bool useMask)
inline

Definition at line 144 of file vpRBKltTracker.h.

Referenced by loadJsonConfiguration().

◆ setTrackerWeight() [1/2]

void vpRBFeatureTracker::setTrackerWeight ( const std::shared_ptr< vpTemporalWeighting > & weight)
inlineinherited

◆ setTrackerWeight() [2/2]

void vpRBFeatureTracker::setTrackerWeight ( double weight)
inlineinherited

◆ shouldUseMask()

bool vpRBKltTracker::shouldUseMask ( ) const
inline

Returns whether the tracking algorithm should filter out points that are unlikely to be on the object according to the mask. If the mask is not computed beforehand, then it has no effect.

Definition at line 143 of file vpRBKltTracker.h.

◆ trackFeatures()

void vpRBKltTracker::trackFeatures ( const vpRBFeatureTrackerInput & frame,
const vpRBFeatureTrackerInput & previousFrame,
const vpHomogeneousMatrix & cMo )
virtual

Track the features.

Implements vpRBFeatureTracker.

◆ updateCovariance()

void vpRBFeatureTracker::updateCovariance ( const double lambda)
virtualinherited

Update the covariance matrix.

Parameters
lambdathe visual servoing gain

Reimplemented in vpRBSilhouetteCCDTracker.

Definition at line 49 of file vpRBFeatureTracker.cpp.

References computeCovarianceMatrix(), vpMatrix::diag(), m_cov, m_covWeightDiag, m_error, and m_L.

◆ updateOptimizerTerms()

void vpRBFeatureTracker::updateOptimizerTerms ( const vpHomogeneousMatrix & cMo)
inlineinherited

◆ vvsHasConverged()

bool vpRBFeatureTracker::vvsHasConverged ( ) const
inlineinherited

Returns whether the tracker is considered as having converged to the desired pose.

Definition at line 200 of file vpRBFeatureTracker.h.

References m_vvsConverged.

Member Data Documentation

◆ m_cov

◆ m_covWeightDiag

vpColVector vpRBFeatureTracker::m_covWeightDiag
protectedinherited

◆ m_enableDisplay

bool vpRBFeatureTracker::m_enableDisplay
protectedinherited

Whether VVS has converged, should be updated every VVS iteration.

Definition at line 314 of file vpRBFeatureTracker.h.

Referenced by featuresShouldBeDisplayed(), loadJsonConfiguration(), setFeaturesShouldBeDisplayed(), and vpRBFeatureTracker().

◆ m_error

◆ m_estimatedDofs

std::array<bool, 6> vpRBFeatureTracker::m_estimatedDofs
protectedinherited

Whether the tracked features should be displayed.

Definition at line 315 of file vpRBFeatureTracker.h.

Referenced by computeoJo(), hasIgnoredDofs(), and setEstimatedDofs().

◆ m_jacobianInObjectSpace

bool vpRBFeatureTracker::m_jacobianInObjectSpace
protectedinherited

◆ m_L

◆ m_LTL

vpMatrix vpRBFeatureTracker::m_LTL
protectedinherited

Error jacobian (In VS terms, the interaction matrix).

Definition at line 299 of file vpRBFeatureTracker.h.

Referenced by vpRBSilhouetteCCDTracker::computeErrorAndInteractionMatrix(), vpRBDenseDepthTracker::computeVVSIter(), getLTL(), and updateOptimizerTerms().

◆ m_LTR

vpColVector vpRBFeatureTracker::m_LTR
protectedinherited

◆ m_numFeatures

◆ m_oJo

vpMatrix vpRBFeatureTracker::m_oJo
protectedinherited

◆ m_vvsConverged

bool vpRBFeatureTracker::m_vvsConverged
protectedinherited

◆ m_weighted_error

◆ m_weighting

std::shared_ptr<vpTemporalWeighting> vpRBFeatureTracker::m_weighting
protectedinherited

◆ m_weights