36 #ifndef VP_RB_DENSE_DEPTH_TRACKER_H
37 #define VP_RB_DENSE_DEPTH_TRACKER_H
39 #include <visp3/core/vpConfig.h>
40 #include <visp3/core/vpImage.h>
41 #include <visp3/core/vpCameraParameters.h>
42 #include <visp3/core/vpPixelMeterConversion.h>
43 #include <visp3/core/vpRobust.h>
44 #include <visp3/core/vpPoint.h>
45 #include <visp3/core/vpHomogeneousMatrix.h>
50 #include <visp3/rbt/vpRBFeatureTracker.h>
56 #if defined(VISP_HAVE_NLOHMANN_JSON)
57 #include VISP_NLOHMANN_JSON(json.hpp)
83 unsigned int getStep()
const {
return m_step; }
107 if (confidence > 1.f || confidence < 0.f) {
110 m_minMaskConfidence = confidence;
142 cameraNormal = cRo * objectNormal;
148 double D = -((cameraNormal[0] * oP.get_X()) + (cameraNormal[1] * oP.get_Y()) + (cameraNormal[2] * oP.get_Z()));
149 double projNormal = cameraNormal[0] * currentPoint[0] + cameraNormal[1] * currentPoint[1] + cameraNormal[2] * currentPoint[2];
151 e[i] = D + projNormal;
157 const double X = currentPoint[0], Y = currentPoint[1], Z = currentPoint[2];
158 const double nx = cameraNormal[0], ny = cameraNormal[1], nz = cameraNormal[2];
162 L[i][3] = nz * Y - ny * Z;
163 L[i][4] = nx * Z - nz * X;
164 L[i][5] = ny * X - nx * Y;
180 #if defined(VISP_HAVE_NLOHMANN_JSON)
184 setStep(j.value(
"step", m_step));
185 setShouldUseMask(j.value(
"useMask", m_useMask));
186 setMinimumMaskConfidence(j.value(
"minMaskConfidence", m_minMaskConfidence));
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
A tracker based on dense depth point-plane alignment.
bool requiresSilhouetteCandidates() const VP_OVERRIDE
Whether this tracker requires Silhouette candidates.
void setMinimumMaskConfidence(float confidence)
void initVVS(const vpRBFeatureTrackerInput &, const vpRBFeatureTrackerInput &, const vpHomogeneousMatrix &) VP_OVERRIDE
void trackFeatures(const vpRBFeatureTrackerInput &, const vpRBFeatureTrackerInput &, const vpHomogeneousMatrix &) VP_OVERRIDE
Track the features.
bool requiresRGB() const VP_OVERRIDE
Whether this tracker requires RGB image to extract features.
virtual void loadJsonConfiguration(const nlohmann::json &j) VP_OVERRIDE
unsigned int getStep() const
void setStep(unsigned int step)
double getVVSTrackerWeight() const VP_OVERRIDE
Get the importance of this tracker in the optimization step. The default computation is the following...
bool shouldUseMask() const
Returns whether the tracking algorithm should filter out points that are unlikely to be on the object...
bool requiresDepth() const VP_OVERRIDE
Whether this tracker requires depth image to extract features.
std::vector< vpDepthPoint > m_depthPoints
void onTrackingIterEnd() VP_OVERRIDE
Method called after the tracking iteration has finished.
float getMinimumMaskConfidence() const
Returns the minimum mask confidence that a pixel linked to depth point should have if it should be ke...
float m_minMaskConfidence
void setShouldUseMask(bool useMask)
void onTrackingIterStart() VP_OVERRIDE
Method called when starting a tracking iteration.
virtual ~vpRBDenseDepthTracker()=default
A base class for all features that can be used and tracked in the vpRBTracker.
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 void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpImage< vpRGBa > &IRGB, const vpImage< unsigned char > &depth) const =0
virtual void loadJsonConfiguration(const nlohmann::json &j)
virtual void computeVVSIter(const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo, unsigned int iteration)=0
Contains an M-estimator and various influence function.
Implementation of a rotation matrix and operations on such kind of matrices.
void update(const vpHomogeneousMatrix &cMo, const vpRotationMatrix &cRo)
void error(vpColVector &e, unsigned i) const
void interaction(vpMatrix &L, unsigned i)