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

#include <vpRBDenseDepthTracker.h>

Inheritance diagram for vpRBDenseDepthTracker:

Classes

struct  vpDepthPoint
class  vpDepthPointSet

Public Types

enum  vpDisplayType {
  DT_SIMPLE = 0 , DT_WEIGHT = 1 , DT_ERROR = 2 , DT_WEIGHT_AND_ERROR = 3 ,
  DT_INVALID = 4
}

Public Member Functions

 vpRBDenseDepthTracker ()
virtual ~vpRBDenseDepthTracker ()=default
bool requiresRGB () const VP_OVERRIDE
bool requiresDepth () const VP_OVERRIDE
bool requiresSilhouetteCandidates () 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 getStep () const
void setStep (unsigned int step)
unsigned int getMaxNumFeatures () const
void setMaxNumFeatures (unsigned int num)
bool shouldUseMask () const
void setShouldUseMask (bool useMask)
float getMinimumMaskConfidence () const
void setMinimumMaskConfidence (float confidence)
vpDisplayType getDisplayType () const
void setDisplayType (vpDisplayType type)
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
std::vector< vpDepthPointm_depthPoints
vpDepthPointSet m_depthPointSet
vpRobust m_robust
unsigned int m_step
unsigned int m_maxFeatures
bool m_useMask
float m_minMaskConfidence
vpDisplayType m_displayType
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 &, const vpRBFeatureTrackerInput &, const vpHomogeneousMatrix &) VP_OVERRIDE
void initVVS (const vpRBFeatureTrackerInput &, const vpRBFeatureTrackerInput &, const vpHomogeneousMatrix &) 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
 NLOHMANN_JSON_SERIALIZE_ENUM (vpRBDenseDepthTracker::vpDisplayType, { {vpRBDenseDepthTracker::vpDisplayType::DT_INVALID, nullptr}, {vpRBDenseDepthTracker::vpDisplayType::DT_SIMPLE, "simple"}, {vpRBDenseDepthTracker::vpDisplayType::DT_WEIGHT, "weight"}, {vpRBDenseDepthTracker::vpDisplayType::DT_ERROR, "error"}, {vpRBDenseDepthTracker::vpDisplayType::DT_WEIGHT_AND_ERROR, "weightAndError"} })
virtual void loadJsonConfiguration (const nlohmann::json &j) VP_OVERRIDE

Detailed Description

A tracker based on dense depth point-plane alignment.

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 76 of file vpRBDenseDepthTracker.h.

Member Enumeration Documentation

◆ vpDisplayType

Enumerator
DT_SIMPLE 
DT_WEIGHT 
DT_ERROR 
DT_WEIGHT_AND_ERROR 
DT_INVALID 

Definition at line 80 of file vpRBDenseDepthTracker.h.

Constructor & Destructor Documentation

◆ vpRBDenseDepthTracker()

vpRBDenseDepthTracker::vpRBDenseDepthTracker ( )
inline

◆ ~vpRBDenseDepthTracker()

virtual vpRBDenseDepthTracker::~vpRBDenseDepthTracker ( )
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()

◆ display()

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

◆ extractFeatures()

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

◆ getDisplayType()

vpDisplayType vpRBDenseDepthTracker::getDisplayType ( ) const
inline

Definition at line 137 of file vpRBDenseDepthTracker.h.

References m_displayType.

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

◆ getMaxNumFeatures()

unsigned int vpRBDenseDepthTracker::getMaxNumFeatures ( ) const
inline

Definition at line 110 of file vpRBDenseDepthTracker.h.

References m_maxFeatures.

◆ getMinimumMaskConfidence()

float vpRBDenseDepthTracker::getMinimumMaskConfidence ( ) const
inline

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

This value is between 0 and 1

Definition at line 128 of file vpRBDenseDepthTracker.h.

References m_minMaskConfidence.

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

◆ getStep()

unsigned int vpRBDenseDepthTracker::getStep ( ) const
inline

Definition at line 101 of file vpRBDenseDepthTracker.h.

References m_step.

◆ 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 vpRBDenseDepthTracker::initVVS ( const vpRBFeatureTrackerInput & ,
const vpRBFeatureTrackerInput & ,
const vpHomogeneousMatrix &  )
inlinevirtual

Implements vpRBFeatureTracker.

Definition at line 160 of file vpRBDenseDepthTracker.h.

◆ loadJsonConfiguration()

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

◆ NLOHMANN_JSON_SERIALIZE_ENUM()

◆ onTrackingIterEnd()

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

Method called after the tracking iteration has finished.

Implements vpRBFeatureTracker.

Definition at line 156 of file vpRBDenseDepthTracker.h.

◆ onTrackingIterStart()

void vpRBDenseDepthTracker::onTrackingIterStart ( const vpRBFeatureTrackerInput & ,
const vpHomogeneousMatrix &  )
inlinevirtual

Method called when starting a tracking iteration.

Implements vpRBFeatureTracker.

Definition at line 155 of file vpRBDenseDepthTracker.h.

◆ requiresDepth()

bool vpRBDenseDepthTracker::requiresDepth ( ) const
inlinevirtual

Whether this tracker requires depth image to extract features.

Implements vpRBFeatureTracker.

Definition at line 94 of file vpRBDenseDepthTracker.h.

◆ requiresRGB()

bool vpRBDenseDepthTracker::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 93 of file vpRBDenseDepthTracker.h.

◆ requiresSilhouetteCandidates()

bool vpRBDenseDepthTracker::requiresSilhouetteCandidates ( ) const
inlinevirtual

Whether this tracker requires Silhouette candidates.

Implements vpRBFeatureTracker.

Definition at line 95 of file vpRBDenseDepthTracker.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.

◆ setDisplayType()

void vpRBDenseDepthTracker::setDisplayType ( vpDisplayType type)
inline

Definition at line 139 of file vpRBDenseDepthTracker.h.

References vpException::badValue, DT_INVALID, and m_displayType.

Referenced by loadJsonConfiguration().

◆ 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

◆ setMaxNumFeatures()

void vpRBDenseDepthTracker::setMaxNumFeatures ( unsigned int num)
inline

Definition at line 111 of file vpRBDenseDepthTracker.h.

References m_maxFeatures.

Referenced by loadJsonConfiguration().

◆ setMinimumMaskConfidence()

void vpRBDenseDepthTracker::setMinimumMaskConfidence ( float confidence)
inline

Definition at line 129 of file vpRBDenseDepthTracker.h.

References vpException::badValue, and m_minMaskConfidence.

Referenced by loadJsonConfiguration().

◆ setShouldUseMask()

void vpRBDenseDepthTracker::setShouldUseMask ( bool useMask)
inline

Definition at line 121 of file vpRBDenseDepthTracker.h.

References m_useMask.

Referenced by loadJsonConfiguration().

◆ setStep()

void vpRBDenseDepthTracker::setStep ( unsigned int step)
inline

Definition at line 102 of file vpRBDenseDepthTracker.h.

References vpException::badValue, and m_step.

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 vpRBDenseDepthTracker::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 120 of file vpRBDenseDepthTracker.h.

References m_useMask.

◆ trackFeatures()

void vpRBDenseDepthTracker::trackFeatures ( const vpRBFeatureTrackerInput & frame,
const vpRBFeatureTrackerInput & previousFrame,
const vpHomogeneousMatrix & cMo )
inlinevirtual

Track the features.

Implements vpRBFeatureTracker.

Definition at line 159 of file vpRBDenseDepthTracker.h.

◆ 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_depthPoints

std::vector<vpDepthPoint> vpRBDenseDepthTracker::m_depthPoints
protected

Definition at line 334 of file vpRBDenseDepthTracker.h.

Referenced by display(), and extractFeatures().

◆ m_depthPointSet

vpDepthPointSet vpRBDenseDepthTracker::m_depthPointSet
protected

Definition at line 335 of file vpRBDenseDepthTracker.h.

Referenced by computeVVSIter(), and extractFeatures().

◆ m_displayType

vpDisplayType vpRBDenseDepthTracker::m_displayType
protected

◆ 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_maxFeatures

unsigned int vpRBDenseDepthTracker::m_maxFeatures
protected

◆ m_minMaskConfidence

float vpRBDenseDepthTracker::m_minMaskConfidence
protected

◆ m_numFeatures

◆ m_oJo

vpMatrix vpRBFeatureTracker::m_oJo
protectedinherited

◆ m_robust

vpRobust vpRBDenseDepthTracker::m_robust
protected

Definition at line 336 of file vpRBDenseDepthTracker.h.

Referenced by computeVVSIter().

◆ m_step

unsigned int vpRBDenseDepthTracker::m_step
protected

◆ m_useMask

bool vpRBDenseDepthTracker::m_useMask
protected

◆ m_vvsConverged

bool vpRBFeatureTracker::m_vvsConverged
protectedinherited

◆ m_weighted_error

◆ m_weighting

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

◆ m_weights