Visual Servoing Platform  version 3.6.1 under development (2025-02-17)
vpRBSilhouetteCCDTracker Class Reference

#include <visp3/rbt/vpRBSilhouetteCCDTracker.h>

+ Inheritance diagram for vpRBSilhouetteCCDTracker:

Public Member Functions

 vpRBSilhouetteCCDTracker ()
 
virtual ~vpRBSilhouetteCCDTracker ()=default
 
bool requiresRGB () const VP_OVERRIDE
 
bool requiresDepth () const VP_OVERRIDE
 
bool requiresSilhouetteCandidates () const VP_OVERRIDE
 
void onTrackingIterStart () VP_OVERRIDE
 
void onTrackingIterEnd () VP_OVERRIDE
 
double getVVSTrackerWeight () const 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 &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
 
void computeVVSIter (const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo, unsigned int iteration) VP_OVERRIDE
 
void updateCovariance (const double) VP_OVERRIDE
 
void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpImage< vpRGBa > &IRGB, const vpImage< unsigned char > &depth) const VP_OVERRIDE
 
virtual void loadJsonConfiguration (const nlohmann::json &j) VP_OVERRIDE
 
unsigned getNumFeatures () const
 
bool vvsHasConverged () const
 
void setTrackerWeight (double weight)
 
virtual vpMatrix getLTL () const
 
virtual vpColVector getLTR () const
 
const vpColVectorgetWeightedError () const
 
Settings
void setCCDParameters (const vpCCDParameters &parameters)
 
vpCCDParameters getCCDParameters () const
 
double getTemporalSmoothingFactor () const
 
void setTemporalSmoothingFactor (double factor)
 
bool shouldUseMask () const
 
void setShouldUseMask (bool useMask)
 
float getMinimumMaskConfidence () const
 
void setMinimumMaskConfidence (float confidence)
 
void setDisplayType (vpRBSilhouetteCCDDisplayType type)
 
Display
bool featuresShouldBeDisplayed () const
 
void setFeaturesShouldBeDisplayed (bool enableDisplay)
 
Covariance computation
virtual const vpMatrix getCovariance () const
 

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

void updateCCDPoints (const vpHomogeneousMatrix &cMo)
 
void computeLocalStatistics (const vpImage< vpRGBa > &I, vpCCDStatistics &stats)
 
void computeErrorAndInteractionMatrix ()
 
double computeMaskGradient (const vpImage< float > &mask, const vpRBSilhouetteControlPoint &pccd) const
 

Protected Attributes

vpCCDParameters m_ccdParameters
 
std::vector< vpRBSilhouetteControlPointm_controlPoints
 
vpRobust m_robust
 
vpCCDStatistics m_stats
 
vpCCDStatistics m_prevStats
 
vpMatrix m_sigma
 
double m_vvsConvergenceThreshold
 
double tol
 
std::vector< vpColVectorm_gradients
 
std::vector< vpMatrixm_hessians
 
vpColVector m_gradient
 
vpMatrix m_hessian
 
double m_temporalSmoothingFac
 
bool m_useMask
 
double m_minMaskConfidence
 
vpRBSilhouetteCCDDisplayType m_displayType
 
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
 
double m_userVvsWeight
 
bool m_vvsConverged
 
bool m_enableDisplay
 

Detailed Description

Tracking based on the Contracting Curve Density algorithm.

Examples
catchRBT.cpp.

Definition at line 191 of file vpRBSilhouetteCCDTracker.h.

Constructor & Destructor Documentation

◆ vpRBSilhouetteCCDTracker()

vpRBSilhouetteCCDTracker::vpRBSilhouetteCCDTracker ( )

Definition at line 144 of file vpRBSilhouetteCCDTracker.cpp.

◆ ~vpRBSilhouetteCCDTracker()

virtual vpRBSilhouetteCCDTracker::~vpRBSilhouetteCCDTracker ( )
virtualdefault

Member Function Documentation

◆ computeCovarianceMatrix()

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

◆ computeErrorAndInteractionMatrix()

◆ computeJTR()

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

◆ computeLocalStatistics()

◆ computeMaskGradient()

double vpRBSilhouetteCCDTracker::computeMaskGradient ( const vpImage< float > &  mask,
const vpRBSilhouetteControlPoint pccd 
) const
protected

◆ computeVVSIter()

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

◆ display()

◆ extractFeatures()

◆ featuresShouldBeDisplayed()

bool vpRBFeatureTracker::featuresShouldBeDisplayed ( ) const
inlineinherited

Definition at line 145 of file vpRBFeatureTracker.h.

◆ getCCDParameters()

vpCCDParameters vpRBSilhouetteCCDTracker::getCCDParameters ( ) const
inline
Examples
catchRBT.cpp.

Definition at line 207 of file vpRBSilhouetteCCDTracker.h.

◆ 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 168 of file vpRBFeatureTracker.h.

◆ getLTL()

virtual vpMatrix vpRBFeatureTracker::getLTL ( ) const
inlinevirtualinherited

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

Definition at line 195 of file vpRBFeatureTracker.h.

◆ getLTR()

virtual vpColVector vpRBFeatureTracker::getLTR ( ) const
inlinevirtualinherited

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

Definition at line 200 of file vpRBFeatureTracker.h.

◆ getMinimumMaskConfidence()

float vpRBSilhouetteCCDTracker::getMinimumMaskConfidence ( ) const
inline

Returns the minimum mask gradient required for a silhouette point to be considered.

This value is between 0 and 1

Definition at line 244 of file vpRBSilhouetteCCDTracker.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 76 of file vpRBFeatureTracker.h.

◆ getTemporalSmoothingFactor()

double vpRBSilhouetteCCDTracker::getTemporalSmoothingFactor ( ) const
inline

Returns the amount of temporal smoothing applied when computing the tracking error and its jacobian. This factor is used to interpolate with the error computed on the previous frame for the features selected at the current iteration Temporal smoothing may help smooth out the motion and reduce jitter.

Examples
catchRBT.cpp.

Definition at line 215 of file vpRBSilhouetteCCDTracker.h.

◆ getVVSTrackerWeight()

double vpRBSilhouetteCCDTracker::getVVSTrackerWeight ( ) const
inlinevirtual

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 from vpRBFeatureTracker.

Definition at line 263 of file vpRBSilhouetteCCDTracker.h.

◆ 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 206 of file vpRBFeatureTracker.h.

◆ initVVS()

◆ loadJsonConfiguration()

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

Reimplemented from vpRBFeatureTracker.

Examples
catchRBT.cpp.

Definition at line 278 of file vpRBSilhouetteCCDTracker.h.

References vpRBFeatureTracker::loadJsonConfiguration().

◆ onTrackingIterEnd()

void vpRBSilhouetteCCDTracker::onTrackingIterEnd ( )
inlinevirtual

Method called after the tracking iteration has finished.

Implements vpRBFeatureTracker.

Definition at line 261 of file vpRBSilhouetteCCDTracker.h.

◆ onTrackingIterStart()

void vpRBSilhouetteCCDTracker::onTrackingIterStart ( )
inlinevirtual

Method called when starting a tracking iteration.

Implements vpRBFeatureTracker.

Definition at line 260 of file vpRBSilhouetteCCDTracker.h.

◆ requiresDepth()

bool vpRBSilhouetteCCDTracker::requiresDepth ( ) const
inlinevirtual

Whether this tracker requires depth image to extract features.

Implements vpRBFeatureTracker.

Definition at line 199 of file vpRBSilhouetteCCDTracker.h.

◆ requiresRGB()

bool vpRBSilhouetteCCDTracker::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 198 of file vpRBSilhouetteCCDTracker.h.

◆ requiresSilhouetteCandidates()

bool vpRBSilhouetteCCDTracker::requiresSilhouetteCandidates ( ) const
inlinevirtual

Whether this tracker requires Silhouette candidates.

Implements vpRBFeatureTracker.

Definition at line 200 of file vpRBSilhouetteCCDTracker.h.

◆ setCCDParameters()

void vpRBSilhouetteCCDTracker::setCCDParameters ( const vpCCDParameters parameters)
inline
Examples
catchRBT.cpp.

Definition at line 206 of file vpRBSilhouetteCCDTracker.h.

◆ setDisplayType()

void vpRBSilhouetteCCDTracker::setDisplayType ( vpRBSilhouetteCCDDisplayType  type)
inline

Definition at line 251 of file vpRBSilhouetteCCDTracker.h.

◆ setFeaturesShouldBeDisplayed()

void vpRBFeatureTracker::setFeaturesShouldBeDisplayed ( bool  enableDisplay)
inlineinherited

Definition at line 146 of file vpRBFeatureTracker.h.

◆ setMinimumMaskConfidence()

void vpRBSilhouetteCCDTracker::setMinimumMaskConfidence ( float  confidence)
inline

Definition at line 245 of file vpRBSilhouetteCCDTracker.h.

◆ setShouldUseMask()

void vpRBSilhouetteCCDTracker::setShouldUseMask ( bool  useMask)
inline
Examples
catchRBT.cpp.

Definition at line 237 of file vpRBSilhouetteCCDTracker.h.

◆ setTemporalSmoothingFactor()

void vpRBSilhouetteCCDTracker::setTemporalSmoothingFactor ( double  factor)
inline

Sets the temporal smoothing factor.

See also
getTemporalSmoothingFactor
Parameters
factorthe new temporal smoothing factor. Should be greater than 0
Examples
catchRBT.cpp.

Definition at line 223 of file vpRBSilhouetteCCDTracker.h.

References vpException::badValue.

◆ setTrackerWeight()

void vpRBFeatureTracker::setTrackerWeight ( double  weight)
inlineinherited

Definition at line 190 of file vpRBFeatureTracker.h.

◆ shouldUseMask()

bool vpRBSilhouetteCCDTracker::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 236 of file vpRBSilhouetteCCDTracker.h.

◆ trackFeatures()

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

Track the features.

Implements vpRBFeatureTracker.

Definition at line 266 of file vpRBSilhouetteCCDTracker.h.

◆ updateCCDPoints()

void vpRBSilhouetteCCDTracker::updateCCDPoints ( const vpHomogeneousMatrix cMo)
protected

Definition at line 335 of file vpRBSilhouetteCCDTracker.cpp.

References m_controlPoints.

Referenced by computeVVSIter().

◆ updateCovariance()

void vpRBSilhouetteCCDTracker::updateCovariance ( const double  lambda)
inlinevirtual

Update the covariance matrix.

Parameters
lambdathe visual servoing gain

Reimplemented from vpRBFeatureTracker.

Definition at line 270 of file vpRBSilhouetteCCDTracker.h.

◆ vvsHasConverged()

bool vpRBFeatureTracker::vvsHasConverged ( ) const
inlineinherited

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

Definition at line 182 of file vpRBFeatureTracker.h.

Member Data Documentation

◆ m_ccdParameters

vpCCDParameters vpRBSilhouetteCCDTracker::m_ccdParameters
protected

◆ m_controlPoints

std::vector<vpRBSilhouetteControlPoint> vpRBSilhouetteCCDTracker::m_controlPoints
protected

◆ m_cov

vpMatrix vpRBFeatureTracker::m_cov
protectedinherited

Right side of the Gauss Newton minimization.

Definition at line 225 of file vpRBFeatureTracker.h.

Referenced by vpRBDenseDepthTracker::computeVVSIter(), vpRBDenseDepthTracker::extractFeatures(), initVVS(), and vpRBFeatureTracker::updateCovariance().

◆ m_covWeightDiag

◆ m_displayType

vpRBSilhouetteCCDDisplayType vpRBSilhouetteCCDTracker::m_displayType
protected

Definition at line 321 of file vpRBSilhouetteCCDTracker.h.

Referenced by display().

◆ m_enableDisplay

bool vpRBFeatureTracker::m_enableDisplay
protectedinherited

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

Definition at line 238 of file vpRBFeatureTracker.h.

Referenced by vpRBFeatureTracker::vpRBFeatureTracker().

◆ m_error

◆ m_gradient

vpColVector vpRBSilhouetteCCDTracker::m_gradient
protected

Definition at line 314 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_gradients

std::vector<vpColVector> vpRBSilhouetteCCDTracker::m_gradients
protected

Definition at line 312 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_hessian

vpMatrix vpRBSilhouetteCCDTracker::m_hessian
protected

Sum of local gradients.

Definition at line 315 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_hessians

std::vector<vpMatrix> vpRBSilhouetteCCDTracker::m_hessians
protected

Definition at line 313 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_L

◆ m_LTL

vpMatrix vpRBFeatureTracker::m_LTL
protectedinherited

Error jacobian (In VS terms, the interaction matrix)

Definition at line 223 of file vpRBFeatureTracker.h.

Referenced by computeErrorAndInteractionMatrix(), vpRBDenseDepthTracker::computeVVSIter(), and vpRBSilhouetteMeTracker::computeVVSIter().

◆ m_LTR

vpColVector vpRBFeatureTracker::m_LTR
protectedinherited

Left side of the Gauss newton minimization.

Definition at line 224 of file vpRBFeatureTracker.h.

Referenced by computeErrorAndInteractionMatrix(), vpRBDenseDepthTracker::computeVVSIter(), and vpRBSilhouetteMeTracker::computeVVSIter().

◆ m_minMaskConfidence

double vpRBSilhouetteCCDTracker::m_minMaskConfidence
protected

Definition at line 319 of file vpRBSilhouetteCCDTracker.h.

Referenced by extractFeatures().

◆ m_numFeatures

◆ m_prevStats

vpCCDStatistics vpRBSilhouetteCCDTracker::m_prevStats
protected

Definition at line 305 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_robust

vpRobust vpRBSilhouetteCCDTracker::m_robust
protected

Silhouette points where to compute CCD statistics.

Definition at line 302 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix().

◆ m_sigma

vpMatrix vpRBSilhouetteCCDTracker::m_sigma
protected

Definition at line 307 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix(), and initVVS().

◆ m_stats

vpCCDStatistics vpRBSilhouetteCCDTracker::m_stats
protected

◆ m_temporalSmoothingFac

double vpRBSilhouetteCCDTracker::m_temporalSmoothingFac
protected

Sum of local hessians.

Definition at line 316 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeErrorAndInteractionMatrix().

◆ m_useMask

bool vpRBSilhouetteCCDTracker::m_useMask
protected

Smoothing factor used to integrate data from the previous frame.

Definition at line 318 of file vpRBSilhouetteCCDTracker.h.

Referenced by extractFeatures().

◆ m_userVvsWeight

double vpRBFeatureTracker::m_userVvsWeight
protectedinherited

Number of considered features.

Definition at line 234 of file vpRBFeatureTracker.h.

Referenced by vpRBFeatureTracker::vpRBFeatureTracker().

◆ m_vvsConverged

bool vpRBFeatureTracker::m_vvsConverged
protectedinherited

◆ m_vvsConvergenceThreshold

double vpRBSilhouetteCCDTracker::m_vvsConvergenceThreshold
protected

Definition at line 309 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeVVSIter().

◆ m_weighted_error

◆ m_weights

◆ tol

double vpRBSilhouetteCCDTracker::tol
protected

Definition at line 310 of file vpRBSilhouetteCCDTracker.h.

Referenced by computeVVSIter(), and initVVS().