35#ifndef VP_RB_FEATURE_TRACKER_H
36#define VP_RB_FEATURE_TRACKER_H
40#include <visp3/core/vpConfig.h>
41#include <visp3/core/vpMatrix.h>
42#include <visp3/core/vpColVector.h>
43#include <visp3/core/vpMatrixException.h>
44#include <visp3/core/vpImage.h>
45#include <visp3/core/vpCameraParameters.h>
46#include <visp3/core/vpRect.h>
47#include <visp3/visual_features/vpFeatureThetaU.h>
49#include <visp3/rbt/vpRBFeatureTrackerInput.h>
50#include <visp3/rbt/vpRBSilhouettePoint.h>
51#include <visp3/rbt/vpTemporalWeighting.h>
53#if defined(VISP_HAVE_NLOHMANN_JSON)
54#include VISP_NLOHMANN_JSON(json.hpp)
192 virtual void updateCovariance(
const double lambda);
228#if defined(VISP_HAVE_NLOHMANN_JSON)
233 const std::array<bool, 6> allDofs {
true,
true,
true,
true,
true,
true };
265 for (
unsigned int i = 0; i <
m_L.getRows(); ++i) {
268 for (
unsigned int dof = 0; dof < 6; ++dof) {
287 for (
unsigned int i = 0; i < 6; ++i) {
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition of the vpImage class member functions.
Implementation of a matrix and operations on matrices.
virtual void onTrackingIterEnd(const vpHomogeneousMatrix &cMo)=0
Method called after the tracking iteration has finished.
void updateOptimizerTerms(const vpHomogeneousMatrix &cMo)
virtual bool requiresDepth() const =0
Whether this tracker requires depth image to extract features.
virtual void extractFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo)=0
Extract features from the frame data and the current pose estimate.
virtual const vpMatrix getCovariance() const
Retrieve the 6 x 6 pose covariance matrix, computed from the weights associated to each feature.
virtual vpColVector getLTR() const
Get the right-side term of the Gauss-Newton optimization term.
vpColVector m_weights
Weighted VS error.
unsigned getNumFeatures() const
Return the type of feature that is used by this tracker.
void setTrackerWeight(double weight)
void setTrackerWeight(const std::shared_ptr< vpTemporalWeighting > &weight)
virtual void trackFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo)=0
Track the features.
virtual bool requiresSilhouetteCandidates() const =0
Whether this tracker requires Silhouette candidates.
virtual void onTrackingIterStart(const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo)=0
Method called when starting a tracking iteration.
std::shared_ptr< vpTemporalWeighting > m_weighting
Number of considered features.
virtual ~vpRBFeatureTracker()=default
bool m_jacobianInObjectSpace
Matrix representation of the estimated DOFS.
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpImage< vpRGBa > &IRGB, const vpImage< unsigned char > &depth) const =0
vpMatrix m_LTL
Error jacobian (In VS terms, the interaction matrix).
bool hasIgnoredDofs() const
virtual void reset()
Resets feature state. Can be called when the object changes or is lost, Ensuring that prior data does...
const vpColVector & getWeightedError() const
Get a weighted version of the error vector. This should not include the userVVSWeight,...
bool m_enableDisplay
Whether VVS has converged, should be updated every VVS iteration.
bool featuresShouldBeDisplayed() const
virtual vpMatrix getLTL() const
Get the left-side term of the Gauss-Newton optimization term.
virtual void loadJsonConfiguration(const nlohmann::json &j)
vpColVector m_covWeightDiag
Covariance matrix.
vpMatrix computeoJo() const
const std::shared_ptr< vpTemporalWeighting > getTemporalTrackerWeight() const
void setFeaturesShouldBeDisplayed(bool enableDisplay)
virtual double getVVSTrackerWeight(double optimizationProgress) const
Get the importance of this tracker in the optimization step. The default computation is the following...
vpColVector m_LTR
Left side of the Gauss newton minimization.
virtual void initVVS(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo)=0
std::array< bool, 6 > m_estimatedDofs
Whether the tracked features should be displayed.
void setEstimatedDofs(const std::array< bool, 6 > &dofs)
static void computeJTR(const vpMatrix &interaction, const vpColVector &error, vpColVector &JTR)
bool m_vvsConverged
User-defined weight for this specific type of feature.
unsigned m_numFeatures
Error weights.
bool vvsHasConverged() const
virtual void computeVVSIter(const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo, unsigned int iteration)=0
vpColVector m_weighted_error
Raw VS Error vector.
virtual bool requiresRGB() const =0
Whether this tracker requires RGB image to extract features.
void setComputeJacobianObjectSpace(bool inObjectSpace)
vpMatrix m_cov
Right side of the Gauss Newton minimization.
static std::shared_ptr< vpTemporalWeighting > parseTemporalWeighting(const nlohmann::json &j)