34 #ifndef _vpMbDepthDenseTracker_h_
35 #define _vpMbDepthDenseTracker_h_
37 #include <visp3/core/vpConfig.h>
38 #include <visp3/core/vpPlane.h>
39 #include <visp3/mbt/vpMbTracker.h>
40 #include <visp3/mbt/vpMbtFaceDepthDense.h>
41 #include <visp3/mbt/vpMbtTukeyEstimator.h>
43 #if DEBUG_DISPLAY_DEPTH_DENSE
44 #include <visp3/core/vpDisplay.h>
55 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false) VP_OVERRIDE;
58 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false) VP_OVERRIDE;
62 virtual std::vector<std::vector<double> >
getModelForDisplay(
unsigned int width,
unsigned int height,
65 bool displayFullModel =
false) VP_OVERRIDE;
67 virtual inline
vpColVector getRobustWeights() const VP_OVERRIDE {
return m_w_depthDense; }
71 virtual void loadConfigFile(
const std::string &configFile,
bool verbose =
true) VP_OVERRIDE;
74 bool verbose = false);
75 #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON)
76 void reInitModel(
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &point_cloud,
const std::string &cad_name,
84 virtual
void setDepthDenseFilteringMaxDistance(
double maxDistance);
85 virtual
void setDepthDenseFilteringMethod(
int method);
86 virtual
void setDepthDenseFilteringMinDistance(
double minDistance);
87 virtual
void setDepthDenseFilteringOccupancyRatio(
double occupancyRatio);
89 inline
void setDepthDenseSamplingStep(
unsigned int stepX,
unsigned int stepY)
91 if (stepX == 0 || stepY == 0) {
92 std::cerr <<
"stepX and stepY must be greater than zero!" << std::endl;
96 m_depthDenseSamplingStepX = stepX;
97 m_depthDenseSamplingStepY = stepY;
104 #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON)
110 void setUseDepthDenseTracking(
const std::string &name,
const bool &useDepthDenseTracking);
114 virtual
void track(const
vpImage<
unsigned char> &) VP_OVERRIDE;
116 #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON)
117 virtual void track(
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &point_cloud);
119 virtual void track(
const std::vector<vpColVector> &point_cloud,
unsigned int width,
unsigned int height);
144 #if DEBUG_DISPLAY_DEPTH_DENSE
151 void computeVisibility(
unsigned int width,
unsigned int height);
155 virtual
void computeVVSInteractionMatrixAndResidu() VP_OVERRIDE;
156 virtual
void computeVVSWeights();
159 virtual
void initCircle(const
vpPoint &p1, const
vpPoint &p2, const
vpPoint &p3,
double radius,
int idFace = 0,
160 const std::
string &name = "") VP_OVERRIDE;
162 virtual
void initCylinder(const
vpPoint &p1, const
vpPoint &p2,
double radius,
int idFace = 0,
163 const std::
string &name = "") VP_OVERRIDE;
165 virtual
void initFaceFromCorners(
vpMbtPolygon &polygon) VP_OVERRIDE;
167 virtual
void initFaceFromLines(
vpMbtPolygon &polygon) VP_OVERRIDE;
169 #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON)
170 void segmentPointCloud(
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &point_cloud);
172 void segmentPointCloud(
const std::vector<vpColVector> &point_cloud,
unsigned int width,
unsigned int height);
173 void segmentPointCloud(
const vpMatrix &point_cloud,
unsigned int width,
unsigned int height);
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Class that defines generic functionalities for display.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
vpMbtTukeyEstimator< double > m_robust_depthDense
Tukey M-Estimator.
vpColVector m_weightedError_depthDense
Weighted error.
unsigned int m_depthDenseSamplingStepY
Sampling step in y-direction.
virtual vpColVector getError() const VP_OVERRIDE
vpMbHiddenFaces< vpMbtPolygon > m_depthDenseHiddenFacesDisplay
Set of faces describing the object used only for display with scan line.
unsigned int m_depthDenseSamplingStepX
Sampling step in x-direction.
vpColVector m_error_depthDense
(s - s*)
vpMatrix m_L_depthDense
Interaction matrix.
std::vector< vpMbtFaceDepthDense * > m_depthDenseListOfActiveFaces
List of current active (visible and features extracted) faces.
unsigned int m_denseDepthNbFeatures
Nb features.
vpColVector m_w_depthDense
Robust weights.
std::vector< vpMbtFaceDepthDense * > m_depthDenseFaces
List of faces.
Main methods for a model-based tracker.
virtual void track(const vpImage< unsigned char > &I)=0
virtual void resetTracker()=0
virtual void init(const vpImage< unsigned char > &I)=0
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false)=0
virtual void setScanLineVisibilityTest(const bool &v)
virtual void setOgreVisibilityTest(const bool &v)
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)=0
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)=0
virtual void computeVVSInit()=0
virtual void testTracking()=0
virtual void loadConfigFile(const std::string &configFile, bool verbose=true)
Implementation of a polygon of the model used by the model-based tracker.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...