36 #ifndef _vpMbtFaceDepthDense_h_
37 #define _vpMbtFaceDepthDense_h_
41 #include <visp3/core/vpConfig.h>
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_types.h>
47 #include <visp3/core/vpPlane.h>
48 #include <visp3/mbt/vpMbTracker.h>
49 #include <visp3/mbt/vpMbtDistanceLine.h>
51 #define DEBUG_DISPLAY_DEPTH_DENSE 0
58 DEPTH_OCCUPANCY_RATIO_FILTERING = 1 << 1,
59 MIN_DISTANCE_FILTERING = 1 << 2,
62 MAX_DISTANCE_FILTERING = 1 << 3
70 unsigned int m_clippingFlag;
74 double m_distNearClip;
88 std::string name =
"");
92 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &point_cloud,
unsigned int stepX,
94 #
if DEBUG_DISPLAY_DEPTH_DENSE
101 bool computeDesiredFeatures(
const vpHomogeneousMatrix &cMo,
unsigned int width,
unsigned int height,
102 const std::vector<vpColVector> &point_cloud,
unsigned int stepX,
104 #
if DEBUG_DISPLAY_DEPTH_DENSE
113 void computeVisibility();
114 void computeVisibilityDisplay();
117 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
119 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
122 double scale = 0.05,
unsigned int thickness = 1);
124 double scale = 0.05,
unsigned int thickness = 1);
126 std::vector<std::vector<double> > getModelForDisplay(
unsigned int width,
unsigned int height,
129 bool displayFullModel =
false);
131 inline unsigned int getNbFeatures()
const {
return (
unsigned int)(m_pointCloudFace.size() / 3); }
133 inline bool isTracked()
const {
return m_isTrackedDepthDenseFace; }
135 inline bool isVisible()
const {
return m_polygon->
isvisible; }
139 void setScanLineVisibilityTest(
bool v);
141 inline void setDepthDenseFilteringMaxDistance(
double maxDistance)
143 m_depthDenseFilteringMaxDist = maxDistance;
146 inline void setDepthDenseFilteringMethod(
int method) { m_depthDenseFilteringMethod = method; }
148 inline void setDepthDenseFilteringMinDistance(
double minDistance)
150 m_depthDenseFilteringMinDist = minDistance;
153 inline void setDepthDenseFilteringOccupancyRatio(
double occupancyRatio)
155 if (occupancyRatio < 0.0 || occupancyRatio > 1.0) {
156 std::cerr <<
"occupancyRatio < 0.0 || occupancyRatio > 1.0" << std::endl;
158 m_depthDenseFilteringOccupancyRatio = occupancyRatio;
162 inline void setTracked(
bool tracked) { m_isTrackedDepthDenseFace = tracked; }
179 PolygonLine() : m_p1(NULL), m_p2(NULL), m_poly(), m_imPt1(), m_imPt2() {}
181 PolygonLine(
const PolygonLine &polyLine)
182 : m_p1(NULL), m_p2(NULL), m_poly(polyLine.m_poly), m_imPt1(polyLine.m_imPt1), m_imPt2(polyLine.m_imPt2)
188 PolygonLine &operator=(PolygonLine other)
195 void swap(PolygonLine &first, PolygonLine &second)
198 swap(first.m_p1, second.m_p1);
199 swap(first.m_p2, second.m_p2);
200 swap(first.m_poly, second.m_poly);
201 swap(first.m_imPt1, second.m_imPt1);
202 swap(first.m_imPt2, second.m_imPt2);
208 int m_depthDenseFilteringMethod;
210 double m_depthDenseFilteringMaxDist;
212 double m_depthDenseFilteringMinDist;
214 double m_depthDenseFilteringOccupancyRatio;
216 bool m_isTrackedDepthDenseFace;
219 std::vector<vpMbtDistanceLine *> m_listOfFaceLines;
224 std::vector<double> m_pointCloudFace;
226 std::vector<PolygonLine> m_polygonLines;
230 std::vector<vpImagePoint> &roiPts
231 #
if DEBUG_DISPLAY_DEPTH_DENSE
233 std::vector<std::vector<vpImagePoint> > &roiPts_vec
236 double &distanceToFace);