Main MRPT website > C++ reference for MRPT 1.9.9
CFaceDetection.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef CFaceDetection_H
11 #define CFaceDetection_H
12 
15 #include <mrpt/utils/CTimeLogger.h>
17 #include <mrpt/obs/obs_frwds.h>
18 
19 #include <future>
20 
21 namespace mrpt
22 {
23 /** \ingroup mrpt_detectors_grp */
24 namespace detectors
25 {
26 /** Specific class for face detection.
27  * Methods and variables labeled as experimentals are temporals (for debug or
28  * testing
29  * purposes) and may disappear in future versions.
30  * \ingroup mrpt_detectors_grp
31  */
33 {
34  public:
36 
38 
40 
41  virtual void init(const mrpt::utils::CConfigFileBase& cfg);
42 
43  virtual void detectObjects_Impl(
45 
46  struct TOptions
47  {
50 
55 
56  bool batchMode;
57 
58  } m_options;
59 
61  {
67 
69 
70  // Experimental methods
72 
74  const vector_uint& falsePositives, const vector_uint& ignore,
75  unsigned int& falsePositivesDeleted, unsigned int& realFacesDeleted);
76 
77  private:
78  /** Thread that execute checkIfFaceRegions filter */
80  /** Thread that execute checkIfFacePlaneCov filter */
82  /** Thread that execute checkIfDiagonalSurface filter */
84 
85  /** Save result of checkIfFaceRegions filter */
87  /** Save result of checkIfFacePlaneCov filter */
89  /** Save result of checkIfDiagonalSurface filter */
91 
92  /** Indicates to all threads that must finish their execution */
94 
95  /** Indicates to thread_checkIfFaceRegions that exist a new face to analyze
96  */
97  std::promise<void> m_enter_checkIfFaceRegions;
98  /** Indicates to thread_checkIfFacePlaneCov that exist a new face to analyze
99  */
100  std::promise<void> m_enter_checkIfFacePlaneCov;
101  /** Indicates to thread_checkIfDiagonalSurface that exist a new face to
102  * analyze */
103  std::promise<void> m_enter_checkIfDiagonalSurface;
104 
105  /** Indicates to main thread that thread_checkIfFaceRegions has been
106  * completed analisis of the last face detected */
107  std::promise<void> m_leave_checkIfFaceRegions;
108  /** Indicates to main thread that thread_checkIfFacePlaneCov has been
109  * completed analisis of the last face detected */
110  std::promise<void> m_leave_checkIfFacePlaneCov;
111  /** Indicates to main thread that thread_checkIfDiagonalSurface has been
112  * completed analisis of the last face detected */
113  std::promise<void> m_leave_checkIfDiagonalSurface;
114 
115  /** Last face detected */
117 
119  {
121 
125 
127 
128  int faceNum;
132 
133  bool takeTime;
134 
136 
137  } m_measure;
138 
139  // To take measures abaout execution time
141 
142  std::vector<double> m_meanHist;
143 
144  // Test to check if a candidate region is a real face
145 
147 
149 
151 
153 
155 
157 
159 
160  size_t checkRelativePosition(
161  const mrpt::math::TPoint3D& p1, const mrpt::math::TPoint3D& p2,
162  const mrpt::math::TPoint3D& p, double& dist);
163 
165 
167 
169 
171 
172  // Experimental methods to view 3D points
173 
175  const std::vector<float>& xs, const std::vector<float>& ys,
176  const std::vector<float>& zs);
177 
180 
182  const std::vector<mrpt::math::TPoint3D>& points);
183 
185  const std::vector<mrpt::math::CArrayDouble<3>>& pointsVector,
186  const mrpt::math::CMatrixDouble& eigenVect,
187  const mrpt::math::CVectorDouble& eigenVal);
188 
190  const std::vector<mrpt::math::TPoint3D> regions[9],
191  const mrpt::math::TPoint3D meanPos[3][3]);
192 
193  // Segmentation methods
197 
198  // Histogram methods
200  const mrpt::utils::CImage& face, const size_t& c1, const size_t& r1,
201  const size_t& c2, const size_t& r2,
203 
204 }; // End of class
205 }
206 }
207 
208 #endif
mrpt::utils::CTimeLogger m_timeLog
std::thread m_thread_checkIfFacePlaneCov
Thread that execute checkIfFacePlaneCov filter.
bool m_end_threads
Indicates to all threads that must finish their execution.
std::vector< uint32_t > vector_uint
Definition: types_simple.h:29
CCascadeClassifierDetection cascadeClassifier
bool m_checkIfFaceRegions_res
Save result of checkIfFaceRegions filter.
void experimental_viewFacePointsAndEigenVects(const std::vector< mrpt::math::CArrayDouble< 3 >> &pointsVector, const mrpt::math::CMatrixDouble &eigenVect, const mrpt::math::CVectorDouble &eigenVal)
A class for storing images as grayscale or RGB bitmaps.
Definition: CImage.h:118
void debug_returnResults(const vector_uint &falsePositives, const vector_uint &ignore, unsigned int &falsePositivesDeleted, unsigned int &realFacesDeleted)
static void dummy_checkIfDiagonalSurface(CFaceDetection *obj)
std::thread m_thread_checkIfDiagonalSurface
Thread that execute checkIfDiagonalSurface filter.
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement, as from a time-of-flight range camera or any other RGBD sensor.
struct mrpt::detectors::CFaceDetection::TTestsOptions m_testsOptions
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:42
std::vector< double > m_meanHist
size_t checkRelativePosition(const mrpt::math::TPoint3D &p1, const mrpt::math::TPoint3D &p2, const mrpt::math::TPoint3D &p, double &dist)
std::promise< void > m_enter_checkIfFacePlaneCov
Indicates to thread_checkIfFacePlaneCov that exist a new face to analyze.
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
mrpt::obs::CObservation3DRangeScan m_lastFaceDetected
Last face detected.
This class allows loading and storing values and vectors of different types from a configuration text...
GLsizei const GLfloat * points
Definition: glext.h:5339
std::thread m_thread_checkIfFaceRegions
Thread that execute checkIfFaceRegions filter.
std::promise< void > m_leave_checkIfFaceRegions
Indicates to main thread that thread_checkIfFaceRegions has been completed analisis of the last face ...
bool checkIfDiagonalSurface2(mrpt::obs::CObservation3DRangeScan *face)
bool checkIfFacePlaneCov(mrpt::obs::CObservation3DRangeScan *face)
bool checkIfFaceRegions(mrpt::obs::CObservation3DRangeScan *face)
void experimental_segmentFace(const mrpt::obs::CObservation3DRangeScan &face, mrpt::math::CMatrixTemplate< bool > &region)
bool checkIfDiagonalSurface(mrpt::obs::CObservation3DRangeScan *face)
Specific class for face detection.
std::promise< void > m_leave_checkIfFacePlaneCov
Indicates to main thread that thread_checkIfFacePlaneCov has been completed analisis of the last face...
std::promise< void > m_enter_checkIfDiagonalSurface
Indicates to thread_checkIfDiagonalSurface that exist a new face to analyze.
virtual void init(const mrpt::utils::CConfigFileBase &cfg)
Initialize the object with parameters loaded from the given config source.
struct mrpt::detectors::CFaceDetection::TMeasurement m_measure
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool checkIfFacePlane(mrpt::obs::CObservation3DRangeScan *face)
std::vector< CDetectableObject::Ptr > vector_detectable_object
void experimental_viewFacePointsScanned(const std::vector< float > &xs, const std::vector< float > &ys, const std::vector< float > &zs)
virtual void detectObjects_Impl(const mrpt::obs::CObservation *obs, vector_detectable_object &detected)
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
static void dummy_checkIfFacePlaneCov(CFaceDetection *obj)
std::promise< void > m_leave_checkIfDiagonalSurface
Indicates to main thread that thread_checkIfDiagonalSurface has been completed analisis of the last f...
void experimental_calcHist(const mrpt::utils::CImage &face, const size_t &c1, const size_t &r1, const size_t &c2, const size_t &r2, mrpt::math::CMatrixTemplate< unsigned int > &hist)
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X), among other stats.
Definition: CTimeLogger.h:45
static void dummy_checkIfFaceRegions(CFaceDetection *obj)
std::promise< void > m_enter_checkIfFaceRegions
Indicates to thread_checkIfFaceRegions that exist a new face to analyze.
Lightweight 3D point.
bool m_checkIfDiagonalSurface_res
Save result of checkIfDiagonalSurface filter.
GLfloat GLfloat p
Definition: glext.h:6305
struct mrpt::detectors::CFaceDetection::TOptions m_options
bool m_checkIfFacePlaneCov_res
Save result of checkIfFacePlaneCov filter.
GLenum GLuint GLint GLenum face
Definition: glext.h:8194
void experimental_viewRegions(const std::vector< mrpt::math::TPoint3D > regions[9], const mrpt::math::TPoint3D meanPos[3][3])



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019