MRPT  2.0.4
test.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include <mrpt/core/exceptions.h>
11 #include <mrpt/detectors.h>
12 #include <mrpt/examples_config.h>
13 #include <mrpt/gui.h>
15 #include <mrpt/img/TColor.h>
18 #include <mrpt/obs/CRawlog.h>
22 #include <iostream>
23 
24 using namespace mrpt;
25 using namespace mrpt::maps;
26 using namespace mrpt::obs;
27 using namespace mrpt::gui;
28 using namespace mrpt::math;
29 using namespace mrpt::hwdrivers;
30 using namespace mrpt::detectors;
31 using namespace mrpt::config;
32 using namespace std;
33 using namespace mrpt::img;
34 using namespace mrpt::serialization;
35 
36 string myDataDir(MRPT_EXAMPLES_BASE_DIRECTORY + string("detectors_face/"));
37 string myInitFile(
38  MRPT_EXAMPLES_BASE_DIRECTORY +
39  string("detectors_face/FACE_DETECTION_TEST.INI"));
40 
41 CFaceDetection faceDetector; // Face detector object
42 
43 bool showEachDetectedFace; // If using a 3D face detection (actually with
44 // swissrange) and we want stop every a face is
45 // detected for analize it.
46 bool batchMode;
47 vector<string> rawlogs;
48 vector<std::vector<uint32_t>> falsePositives;
49 vector<std::vector<uint32_t>> ignored;
50 string rawlogsDir;
51 
52 #ifdef MRPT_OPENCV_SRC_DIR
53 static string OPENCV_SRC_DIR = MRPT_OPENCV_SRC_DIR;
54 #else
55 static string OPENCV_SRC_DIR = "./";
56 #endif
57 
58 // ------------------------------------------------------
59 // TestCamera3DFaceDetection
60 // ------------------------------------------------------
62 {
63  CDisplayWindow win("Live video");
64  CDisplayWindow win2("FaceDetected");
65 
66  cout << "Close the window to exit." << endl;
67 
68  mrpt::gui::CDisplayWindow3D win3D("3D camera view", 800, 600);
70 
71  win3D.setCameraAzimuthDeg(140);
72  win3D.setCameraElevationDeg(20);
73  win3D.setCameraZoom(6.0);
74  win3D.setCameraPointingToPoint(2.5, 0, 0);
75 
76  mrpt::opengl::COpenGLScene::Ptr& scene = win3D.get3DSceneAndLock();
78 
81  gl_points->setPointSize(4.5);
82 
85  gl_points2->setPointSize(4.5);
86 
87  // Create the Opengl object for the point cloud:
88  scene->insert(gl_points);
89  scene->insert(mrpt::opengl::CGridPlaneXY::Create());
91 
92  win3D.unlockAccess3DScene();
93 
95  {
96  win3D2.setWindowTitle("3D Face detected");
97  win3D2.resize(400, 300);
98 
99  win3D2.setCameraAzimuthDeg(140);
100  win3D2.setCameraElevationDeg(20);
101  win3D2.setCameraZoom(6.0);
102  win3D2.setCameraPointingToPoint(2.5, 0, 0);
103 
104  scene2 = win3D2.get3DSceneAndLock();
105 
106  scene2->insert(gl_points2);
107  scene2->insert(mrpt::opengl::CGridPlaneXY::Create());
108 
109  win3D2.unlockAccess3DScene();
110  }
111 
112  double counter = 0;
113  mrpt::system::CTicTac tictac;
114 
115  CVectorDouble fps;
116 
117  while (win.isOpen())
118  {
119  if (!counter) tictac.Tic();
120 
122 
123  try
124  {
125  o = std::dynamic_pointer_cast<CObservation3DRangeScan>(
126  cam->getNextFrame());
127  }
128  catch (CExceptionEOF&)
129  {
130  break;
131  }
132  ASSERT_(o);
133 
134  vector_detectable_object detected;
135 
136  // CObservation3DRangeScan::Ptr o =
137  // std::dynamic_pointer_cast<CObservation3DRangeScan>(obs);
138 
139  faceDetector.detectObjects(o, detected);
140  // static int x = 0;
141 
142  if (detected.size() > 0)
143  {
144  for (unsigned int i = 0; i < detected.size(); i++)
145  {
146  ASSERT_(IS_CLASS(*detected[i], CDetectable3D));
147  CDetectable3D::Ptr obj =
148  std::dynamic_pointer_cast<CDetectable3D>(detected[i]);
149 
151  {
153  o->getZoneAsObs(
154  face, obj->m_y, obj->m_y + obj->m_height, obj->m_x,
155  obj->m_x + obj->m_width);
156  win2.showImage(face.intensityImage);
157 
158  if (o->hasPoints3D)
159  {
160  win3D2.get3DSceneAndLock();
161 
162  CColouredPointsMap pntsMap;
163 
164  if (!o->hasConfidenceImage)
165  {
166  pntsMap.colorScheme.scheme =
168  pntsMap.loadFromRangeScan(face);
169  }
170  else
171  {
172  vector<float> xs, ys, zs;
173  unsigned int i = 0;
174  for (unsigned int j = 0;
175  j < face.confidenceImage.getHeight(); j++)
176  for (unsigned int k = 0;
177  k < face.confidenceImage.getWidth();
178  k++, i++)
179  {
180  unsigned char c =
181  *(face.confidenceImage(k, j, 0));
182  if (c > faceDetector.m_options
184  {
185  xs.push_back(face.points3D_x[i]);
186  ys.push_back(face.points3D_y[i]);
187  zs.push_back(face.points3D_z[i]);
188  }
189  }
190 
191  pntsMap.setAllPoints(xs, ys, zs);
192  }
193 
194  gl_points2->loadFromPointsMap(&pntsMap);
195 
196  win3D2.unlockAccess3DScene();
197  win3D2.repaint();
198  }
199  }
200 
201  o->intensityImage.rectangle(
202  obj->m_x, obj->m_y, obj->m_x + obj->m_width,
203  obj->m_y + obj->m_height, TColor(255, 0, 0));
204 
205  // x++;
206  // if (( showEachDetectedFace ) && ( x > 430 ) )
207  // system::pause();
208  }
209  }
210 
211  win.showImage(o->intensityImage);
212 
213  /*if (( showEachDetectedFace ) && ( detected.size() ))
214  system::pause();*/
215 
216  win3D.get3DSceneAndLock();
217  CColouredPointsMap pntsMap;
219  pntsMap.loadFromRangeScan(*(o.get()));
220 
221  gl_points->loadFromPointsMap(&pntsMap);
222  win3D.unlockAccess3DScene();
223  win3D.repaint();
224 
225  if (++counter == 10)
226  {
227  double t = tictac.Tac();
228  cout << "Frame Rate: " << counter / t << " fps" << endl;
229  fps.push_back(counter / t);
230  counter = 0;
231  }
232  std::this_thread::sleep_for(2ms);
233  }
234 
235  cout << "Fps mean: " << fps.sum() / fps.size() << endl;
236 
238 
239  cout << "Closing..." << endl;
240 }
241 
242 // ------------------------------------------------------
243 // TestCameraFaceDetection
244 // ------------------------------------------------------
246 {
248 
249  if (!cam)
250  {
251  cerr << "The user didn't pick any camera. Exiting." << endl;
252  return;
253  }
254 
255  mrpt::obs::CObservation::Ptr obs = cam->getNextFrame();
256  ASSERT_(obs);
257 
259  {
261  return;
262  }
263 
264  CDisplayWindow win("Live video");
265 
266  cout << "Close the window to exit." << endl;
267 
268  double counter = 0;
269  mrpt::system::CTicTac tictac;
270 
271  while (win.isOpen())
272  {
273  if (!counter) tictac.Tic();
274 
276  try
277  {
278  obs = cam->getNextFrame();
279  }
280  catch (CExceptionEOF&) // Check if eof, f.i. for RawLog files
281  {
282  break;
283  }
284  ASSERT_(obs);
285 
286  if (IS_CLASS(*obs, CObservationImage))
287  {
288  vector_detectable_object detected;
289  faceDetector.detectObjects(obs, detected);
290 
292  std::dynamic_pointer_cast<CObservationImage>(obs);
293  for (unsigned int i = 0; i < detected.size(); i++)
294  {
295  ASSERT_(IS_CLASS(*detected[i], CDetectable2D));
296  CDetectable2D::Ptr obj =
297  std::dynamic_pointer_cast<CDetectable2D>(detected[i]);
298  o->image.rectangle(
299  obj->m_x, obj->m_y, obj->m_x + obj->m_width,
300  obj->m_y + obj->m_height, TColor(255, 0, 0));
301  }
302 
303  win.showImage(o->image);
304  }
305  else if (IS_CLASS(*obs, CObservationStereoImages))
306  {
307  vector_detectable_object detected;
308  faceDetector.detectObjects(obs, detected);
309 
311  std::dynamic_pointer_cast<CObservationStereoImages>(obs);
312 
313  for (unsigned int i = 0; i < detected.size(); i++)
314  {
315  ASSERT_(IS_CLASS(*detected[i], CDetectable2D));
316  CDetectable2D::Ptr obj =
317  std::dynamic_pointer_cast<CDetectable2D>(detected[i]);
318  o->imageRight.rectangle(
319  obj->m_x, obj->m_y, obj->m_x + obj->m_width,
320  obj->m_y + obj->m_height, TColor(255, 0, 0));
321  }
322 
323  win.showImage(o->imageRight);
324  }
325 
326  if (++counter == 10)
327  {
328  double t = tictac.Tac();
329  cout << "Frame Rate: " << counter / t << " fps" << endl;
330  counter = 0;
331  }
332  std::this_thread::sleep_for(2ms);
333  }
334 
335  cout << "Closing..." << endl;
336 }
337 
338 // ------------------------------------------------------
339 // TestImagesFaceDetection
340 // ------------------------------------------------------
341 void TestImagesFaceDetection(int argc, char* argv[])
342 {
343  CImage img;
344  CDisplayWindow win("Result");
345  mrpt::system::CTicTac tictac;
346 
347  // For each aditional argument, tty to load an image and detect faces
348  for (int i = 1; i < argc; i++)
349  {
350  string fileName(argv[i]);
351 
352  if (!img.loadFromFile(myDataDir + fileName))
353  {
354  cerr << "Cannot load " << myDataDir + fileName << endl;
355  continue;
356  }
357 
358  vector_detectable_object detected;
359 
360  tictac.Tic();
361 
362  faceDetector.detectObjects(&img, detected);
363 
364  cout << "Detection time: " << tictac.Tac() << " s" << endl;
365 
366  for (unsigned int i = 0; i < detected.size(); i++)
367  {
368  ASSERT_(IS_CLASS(*detected[i], CDetectable2D));
369  CDetectable2D::Ptr obj =
370  std::dynamic_pointer_cast<CDetectable2D>(detected[i]);
371  img.rectangle(
372  obj->m_x, obj->m_y, obj->m_x + obj->m_width,
373  obj->m_y + obj->m_height, TColor(255, 0, 0));
374  }
375 
376  win.showImage(img);
377 
379  }
380 }
381 
382 void BatchMode()
383 {
384  vector<double> frame_rates;
385 
386  for (size_t i = 0; i < rawlogs.size(); i++)
387  {
388  CRawlog rawlog;
389 
390  rawlog.loadFromRawLogFile(string(rawlogsDir + rawlogs[i] + ".rawlog"));
391 
392  cout << "Processing Rawlog [" << i + 1 << "/" << rawlogs.size()
393  << "]: " << rawlogs[i] << endl;
394 
395  const unsigned int size = rawlog.size();
396 
397  mrpt::system::CTicTac tictac;
398  size_t counter = 0;
399 
400  // PROCESS RAWLOG
401  for (unsigned int j = 1; j < size; j++)
402  {
403  if (!counter) tictac.Tic();
404 
406  std::dynamic_pointer_cast<CObservation3DRangeScan>(
407  rawlog.getAsObservation(j));
408 
409  ASSERT_(o);
410 
411  vector_detectable_object detected;
412 
413  faceDetector.detectObjects(o, detected);
414 
415  if (++counter == 10)
416  {
417  double t = tictac.Tac();
418  frame_rates.push_back(counter / t);
419  counter = 0;
420  }
421 
422  std::this_thread::sleep_for(2ms);
423  }
424 
425  unsigned int falsePositivesDeleted, realFacesDeleted;
427  falsePositives[i], ignored[i], falsePositivesDeleted,
428  realFacesDeleted);
429  cout << "False positives deleted: " << falsePositivesDeleted << endl;
430  cout << "Real faces delted: " << realFacesDeleted << endl << endl;
431  }
432 
433  cout << "Mean frame rate: " << sum(frame_rates) / frame_rates.size();
434 
435  // faceDetector.experimental_showMeasurements();
436 
437  system::pause();
438 }
439 
440 void mySplit(const string& str)
441 {
442  char *cstr, *p;
443 
444  cstr = new char[str.size() + 1];
445  strcpy(cstr, str.c_str());
446 
447  // cstr now contains a c-string copy of str
448 
449  p = strtok(cstr, " ");
450  while (p != nullptr)
451  {
452  string part(p);
453  rawlogs.push_back(part);
454  p = strtok(nullptr, " ");
455  }
456 
457  delete[] cstr;
458 }
459 
460 // ------------------------------------------------------
461 // TestPrepareDetector
462 // ------------------------------------------------------
463 void TestPrepareDetector()
464 {
465  CConfigFile cfg(myInitFile);
466 
467  int classifierType = cfg.read_int("Example", "classifierType", 0);
468 
469  if (classifierType == 0) // Haar
470  cfg.write(
471  "CascadeClassifier", "cascadeFileName",
473  "/data/haarcascades/haarcascade_frontalface_alt2.xml");
474  else if (classifierType == 1) // LBP
475  cfg.write(
476  "CascadeClassifier", "cascadeFileName",
477  OPENCV_SRC_DIR + "/data/lbpcascades/lbpcascade_frontalface.xml");
478  else
479  throw std::runtime_error("Incorrect cascade classifier type.");
480 
482  cfg.read_bool("Example", "showEachDetectedFace", false);
483  batchMode = cfg.read_bool("Example", "batchMode", false);
484 
485  if (batchMode)
486  {
487  string str = cfg.read_string("Example", "rawlogs", "noRawlogs");
488  mySplit(str);
489 
490  size_t numRawlogs = rawlogs.size();
491  falsePositives.resize(numRawlogs);
492  ignored.resize(numRawlogs);
493 
494  for (size_t i = 0; i < numRawlogs; i++)
495  {
496  cfg.read_vector(
497  rawlogs[i], "falsePositives", std::vector<uint32_t>(),
498  falsePositives[i]);
499  cfg.read_vector(
500  rawlogs[i], "ignored", std::vector<uint32_t>(), ignored[i]);
501  }
502 
503  rawlogsDir = cfg.read_string("Example", "rawlogsDir", "");
504  }
505 
506  faceDetector.init(cfg);
507 }
508 
509 // ------------------------------------------------------
510 // MAIN
511 // ------------------------------------------------------
512 int main(int argc, char* argv[])
513 {
514  try
515  {
519 
521 
522  if (batchMode)
523  BatchMode();
524  else
525  {
526  if (argc > 1)
528  else
530  }
531 
532  return 0;
533  }
534  catch (const std::exception& e)
535  {
536  std::cerr << "MRPT error: " << mrpt::exception_to_str(e) << std::endl;
537  return -1;
538  }
539  catch (...)
540  {
541  printf("Untyped exception!!");
542  return -1;
543  }
544 }
mrpt::config
Definition: config/CConfigFile.h:15
mrpt::math::sum
CONTAINER::Scalar sum(const CONTAINER &v)
Computes the sum of all the elements.
Definition: ops_containers.h:221
mrpt::obs::CObservation::Ptr
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:45
rawlogs
vector< string > rawlogs
Definition: vision_stereo_rectify/test.cpp:47
ops_containers.h
mrpt::obs::CRawlog
This class stores a rawlog (robotic datasets) in one of two possible formats:
Definition: CRawlog.h:66
mrpt::rtti::registerClass
void registerClass(const mrpt::rtti::TRuntimeClassId *pNewClass)
Register a class into the MRPT internal list of "CObject" descendents.
Definition: internal_class_registry.cpp:183
mrpt::img::CImage::getWidth
size_t getWidth() const override
Returns the width of the image in pixels.
Definition: CImage.cpp:818
exceptions.h
mrpt::detectors::CFaceDetection::init
void init(const mrpt::config::CConfigFileBase &cfg) override
Initialize the object with parameters loaded from the given config source.
Definition: CFaceDetection.cpp:76
rawlogsDir
string rawlogsDir
Definition: vision_stereo_rectify/test.cpp:50
OPENCV_SRC_DIR
static string OPENCV_SRC_DIR
Definition: vision_stereo_rectify/test.cpp:55
mrpt::maps::CColouredPointsMap
A map of 2D/3D points with individual colours (RGB).
Definition: CColouredPointsMap.h:30
mrpt::detectors
Definition: CCascadeClassifierDetection.h:15
mrpt::maps::CColouredPointsMap::colorScheme
TColourOptions colorScheme
The options employed when inserting laser scans in the map.
Definition: CColouredPointsMap.h:219
mrpt::gui::CDisplayWindow3D::setWindowTitle
void setWindowTitle(const std::string &str) override
Changes the window title.
Definition: CDisplayWindow3D.cpp:460
mrpt::maps::CColouredPointsMap::cmFromIntensityImage
@ cmFromIntensityImage
Definition: CColouredPointsMap.h:198
mrpt::system::CTicTac
A high-performance stopwatch, with typical resolution of nanoseconds.
Definition: system/CTicTac.h:18
mrpt::detectors::CFaceDetection
Specific class for face detection.
Definition: CFaceDetection.h:32
mrpt::maps::CColouredPointsMap::TColourOptions::scheme
TColouringMethod scheme
Definition: CColouredPointsMap.h:213
mrpt::opengl::CPointCloudColoured::Ptr
std::shared_ptr< mrpt::opengl ::CPointCloudColoured > Ptr
Definition: CPointCloudColoured.h:48
mrpt::obs::CObservation3DRangeScan::points3D_z
std::vector< float > points3D_z
Definition: CObservation3DRangeScan.h:329
mrpt::obs::CObservationImage::Ptr
std::shared_ptr< mrpt::obs ::CObservationImage > Ptr
Definition: CObservationImage.h:34
IS_CLASS
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class.
Definition: CObject.h:146
batchMode
bool batchMode
Definition: vision_stereo_rectify/test.cpp:46
CPointCloudColoured.h
mrpt::gui::CDisplayWindow3D::setCameraZoom
void setCameraZoom(float zoom)
Changes the camera parameters programmatically.
Definition: CDisplayWindow3D.cpp:554
myDataDir
std::string myDataDir
Definition: vision_stereo_rectify/test.cpp:23
mrpt::hwdrivers
Contains classes for various device interfaces.
Definition: C2DRangeFinderAbstract.h:20
CCameraSensor.h
mrpt::gui::CDisplayWindow3D::get3DSceneAndLock
mrpt::opengl::COpenGLScene::Ptr & get3DSceneAndLock()
Gets a reference to the smart shared pointer that holds the internal scene (carefuly read introductio...
Definition: CDisplayWindow3D.cpp:479
falsePositives
vector< std::vector< uint32_t > > falsePositives
Definition: vision_stereo_rectify/test.cpp:48
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: BaseAppDataSource.h:16
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
stock_objects.h
mrpt::obs::CObservation3DRangeScan::points3D_y
std::vector< float > points3D_y
Definition: CObservation3DRangeScan.h:329
mrpt::math::MatrixVectorBase::sum
Scalar sum() const
Sum of all elements in matrix/vector.
Definition: MatrixVectorBase_impl.h:345
mrpt::gui::CDisplayWindow3D::resize
void resize(unsigned int width, unsigned int height) override
Resizes the window, stretching the image to fit into the display area.
Definition: CDisplayWindow3D.cpp:413
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:18
mrpt::img::CCanvas::rectangle
void rectangle(int x0, int y0, int x1, int y1, const mrpt::img::TColor color, unsigned int width=1)
Draws a rectangle (an empty rectangle, without filling)
Definition: CCanvas.cpp:161
mrpt::detectors::CFaceDetection::m_options
struct mrpt::detectors::CFaceDetection::TOptions m_options
mrpt::system::CTicTac::Tac
double Tac() noexcept
Stops the stopwatch.
Definition: CTicTac.cpp:87
mrpt::detectors::CDetectable2D::Ptr
std::shared_ptr< mrpt::detectors ::CDetectable2D > Ptr
Definition: CDetectableObject.h:45
main
int main()
Definition: vision_stereo_rectify/test.cpp:78
mrpt::detectors::CObjectDetection::detectObjects
void detectObjects(const mrpt::obs::CObservation::Ptr obs, vector_detectable_object &detected)
Definition: CObjectDetection.h:36
TestPrepareDetector
void TestPrepareDetector()
Definition: vision_stereo_rectify/test.cpp:463
mrpt::hwdrivers::prepareVideoSourceFromUserSelection
CCameraSensor::Ptr prepareVideoSourceFromUserSelection()
Show to the user a list of possible camera drivers and creates and open the selected camera.
Definition: CCameraSensor.cpp:1473
mrpt::img
Definition: CCanvas.h:17
mrpt::obs::CRawlog::loadFromRawLogFile
bool loadFromRawLogFile(const std::string &fileName, bool non_obs_objects_are_legal=false)
Load the contents from a file containing one of these possibilities:
Definition: CRawlog.cpp:166
mrpt::obs::CObservation3DRangeScan::intensityImage
mrpt::img::CImage intensityImage
If hasIntensityImage=true, a color or gray-level intensity image of the same size than "rangeImage".
Definition: CObservation3DRangeScan.h:484
mrpt::gui::CDisplayWindow3D::setCameraPointingToPoint
void setCameraPointingToPoint(float x, float y, float z)
Changes the camera parameters programmatically.
Definition: CDisplayWindow3D.cpp:538
mrpt::gui::CDisplayWindow3D::unlockAccess3DScene
void unlockAccess3DScene()
Unlocks the access to the internal 3D scene.
Definition: CDisplayWindow3D.cpp:485
mrpt::maps::CPointsMap::setAllPoints
void setAllPoints(const std::vector< float > &X, const std::vector< float > &Y, const std::vector< float > &Z)
Set all the points at once from vectors with X,Y and Z coordinates.
Definition: CPointsMap.h:705
mrpt::obs::CObservation3DRangeScan
A range or depth 3D scan measurement, as from a time-of-flight range camera or a structured-light dep...
Definition: CObservation3DRangeScan.h:169
mrpt::opengl::CPointCloudColoured::Create
static Ptr Create(Args &&... args)
Definition: CPointCloudColoured.h:48
mrpt::opengl::CGridPlaneXY::Create
static Ptr Create(Args &&... args)
Definition: CGridPlaneXY.h:31
win
mrpt::gui::CDisplayWindow3D::Ptr win
Definition: vision_stereo_rectify/test.cpp:31
mrpt::system::strtok
char * strtok(char *str, const char *strDelimit, char **context) noexcept
An OS-independent method for tokenizing a string.
Definition: string_utils.cpp:197
mrpt::obs::CRawlog::size
size_t size() const
Returns the number of actions / observations object in the sequence.
Definition: CRawlog.cpp:64
detectors.h
mrpt::gui::CDisplayWindow3D::setCameraElevationDeg
void setCameraElevationDeg(float deg)
Changes the camera parameters programmatically.
Definition: CDisplayWindow3D.cpp:508
mrpt::detectors::CFaceDetection::TOptions::confidenceThreshold
int confidenceThreshold
Definition: CFaceDetection.h:48
mrpt::obs::CObservation3DRangeScan::points3D_x
std::vector< float > points3D_x
If hasPoints3D=true, the (X,Y,Z) coordinates of the 3D point cloud detected by the camera.
Definition: CObservation3DRangeScan.h:329
mrpt::img::TColor
A RGB color - 8bit.
Definition: TColor.h:26
mrpt::math::size
size_t size(const MATRIXLIKE &m, const int dim)
Definition: math/include/mrpt/math/bits_math.h:21
argv
const char * argv[]
Definition: RawlogGrabberApp_unittest.cpp:50
mrpt::obs::CObservation3DRangeScan::confidenceImage
mrpt::img::CImage confidenceImage
If hasConfidenceImage=true, an image with the "confidence" value [range 0-255] as estimated by the ca...
Definition: CObservation3DRangeScan.h:497
mrpt::system::CTicTac::Tic
void Tic() noexcept
Starts the stopwatch.
Definition: CTicTac.cpp:76
mrpt::gui::CDisplayWindow
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
Definition: CDisplayWindow.h:34
mrpt::serialization
Definition: aligned_serialization.h:14
mrpt::gui
Classes for creating GUI windows for 2D and 3D visualization.
Definition: about_box.h:15
mrpt::math::CVectorDynamic< double >
mrpt::img::CImage
A class for storing images as grayscale or RGB bitmaps.
Definition: img/CImage.h:149
mrpt::detectors::CDetectable2D
Definition: CDetectableObject.h:44
mrpt::detectors::CDetectable3D
Definition: CDetectableObject.h:75
mrpt::math::CVectorDynamic::size
size_type size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x))
Definition: CVectorDynamic.h:141
mrpt::detectors::vector_detectable_object
std::vector< CDetectableObject::Ptr > vector_detectable_object
Definition: CObjectDetection.h:18
mrpt::opengl::COpenGLScene::Ptr
std::shared_ptr< mrpt::opengl ::COpenGLScene > Ptr
Definition: COpenGLScene.h:58
CLASS_ID
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
Definition: CObject.h:102
mrpt::opengl::stock_objects::CornerXYZ
CSetOfObjects::Ptr CornerXYZ(float scale=1.0)
Returns three arrows representing a X,Y,Z 3D corner.
Definition: StockObjects.cpp:136
counter
int counter
Definition: visit_each_unittest.cpp:15
mrpt::img::CImage::getHeight
size_t getHeight() const override
Returns the height of the image in pixels.
Definition: CImage.cpp:855
argc
const int argc
Definition: RawlogGrabberApp_unittest.cpp:51
mrpt::serialization::CExceptionEOF
Used in mrpt::serialization::CArchive.
Definition: CArchive.h:37
mrpt::maps::CColouredPointsMap::loadFromRangeScan
void loadFromRangeScan(const mrpt::obs::CObservation2DRangeScan &rangeScan, const mrpt::poses::CPose3D *robotPose=nullptr) override
See CPointsMap::loadFromRangeScan()
Definition: CColouredPointsMap.cpp:989
TestCamera3DFaceDetection
void TestCamera3DFaceDetection(CCameraSensor::Ptr cam)
Definition: vision_stereo_rectify/test.cpp:61
mrpt::config::CConfigFile
This class allows loading and storing values and vectors of different types from "....
Definition: config/CConfigFile.h:32
mrpt::obs::CObservation3DRangeScan::getZoneAsObs
void getZoneAsObs(CObservation3DRangeScan &obs, const unsigned int &r1, const unsigned int &r2, const unsigned int &c1, const unsigned int &c2)
Extract a ROI of the 3D observation as a new one.
Definition: CObservation3DRangeScan.cpp:1023
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:12
mrpt::math::CVectorDynamic::push_back
void push_back(const T &val)
Definition: CVectorDynamic.h:197
faceDetector
CFaceDetection faceDetector
Definition: vision_stereo_rectify/test.cpp:41
gui.h
CColouredPointsMap.h
mrpt::detectors::CDetectableObject
Base class that contains common atributes and functions of detectable objects.
Definition: CDetectableObject.h:26
mrpt::hwdrivers::CCameraSensor::Ptr
std::shared_ptr< CCameraSensor > Ptr
Definition: CCameraSensor.h:353
myInitFile
string myInitFile(MRPT_EXAMPLES_BASE_DIRECTORY+string("detectors_face/FACE_DETECTION_TEST.INI"))
ignored
vector< std::vector< uint32_t > > ignored
Definition: vision_stereo_rectify/test.cpp:49
mrpt::maps
Definition: CBeacon.h:22
mrpt::gui::CDisplayWindow3D::setCameraAzimuthDeg
void setCameraAzimuthDeg(float deg)
Changes the camera parameters programmatically.
Definition: CDisplayWindow3D.cpp:527
mrpt::obs::CObservationStereoImages::Ptr
std::shared_ptr< mrpt::obs ::CObservationStereoImages > Ptr
Definition: CObservationStereoImages.h:40
mrpt::exception_to_str
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
Definition: exceptions.cpp:59
mrpt::gui::CDisplayWindow3D::repaint
void repaint()
Repaints the window.
Definition: CDisplayWindow3D.h:188
mrpt::obs::CRawlog::getAsObservation
CObservation::Ptr getAsObservation(size_t index) const
Returns the i'th element in the sequence, as being an observation, where index=0 is the first object.
Definition: CRawlog.cpp:81
mrpt::system::os::strcpy
char * strcpy(char *dest, size_t destSize, const char *source) noexcept
An OS-independent version of strcpy.
mrpt::detectors::CFaceDetection::debug_returnResults
void debug_returnResults(const std::vector< uint32_t > &falsePositives, const std::vector< uint32_t > &ignore, unsigned int &falsePositivesDeleted, unsigned int &realFacesDeleted)
Definition: CFaceDetection.cpp:1948
mrpt::detectors::CDetectable3D::Ptr
std::shared_ptr< mrpt::detectors ::CDetectable3D > Ptr
Definition: CDetectableObject.h:76
mrpt::img::CImage::loadFromFile
bool loadFromFile(const std::string &fileName, int isColor=-1)
Load image from a file, whose format is determined from the extension (internally uses OpenCV).
Definition: CImage.cpp:304
CRawlog.h
CGridPlaneXY.h
mrpt::obs::CObservation3DRangeScan::Ptr
std::shared_ptr< mrpt::obs ::CObservation3DRangeScan > Ptr
Definition: CObservation3DRangeScan.h:170
TestImagesFaceDetection
void TestImagesFaceDetection(int argc, char *argv[])
Definition: vision_stereo_rectify/test.cpp:341
showEachDetectedFace
bool showEachDetectedFace
Definition: vision_stereo_rectify/test.cpp:43
mrpt::obs::CObservationImage
Declares a class derived from "CObservation" that encapsules an image from a camera,...
Definition: CObservationImage.h:33
mrpt::gui::CDisplayWindow3D
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
Definition: CDisplayWindow3D.h:118
TColor.h
mrpt::obs::CObservationStereoImages
Observation class for either a pair of left+right or left+disparity images from a stereo camera.
Definition: CObservationStereoImages.h:39
mrpt::detectors::CFaceDetection::experimental_showMeasurements
void experimental_showMeasurements()
Definition: CFaceDetection.cpp:1807
BatchMode
void BatchMode()
Definition: vision_stereo_rectify/test.cpp:382
TestCameraFaceDetection
void TestCameraFaceDetection()
Definition: vision_stereo_rectify/test.cpp:245
mrpt::system::pause
void pause(const std::string &msg=std::string("Press any key to continue...")) noexcept
Shows the message "Press any key to continue" (or other custom message) to the current standard outpu...
Definition: os.cpp:441
mySplit
void mySplit(const string &str)
Definition: vision_stereo_rectify/test.cpp:440



Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020