Visual Servoing Platform  version 3.3.1 under development (2020-04-15)
mbtEdgeMultiTracking.cpp
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Example of model based tracking.
33  *
34  * Authors:
35  * Nicolas Melchior
36  * Romain Tallonneau
37  * Aurelien Yol
38  * Souriya Trinh
39  *
40  *****************************************************************************/
41 
49 #include <iostream>
50 #include <visp3/core/vpConfig.h>
51 
52 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
53 
54 #if (defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_DISPLAY)) \
55  && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
56 
57 #include <visp3/core/vpDebug.h>
58 #include <visp3/core/vpHomogeneousMatrix.h>
59 #include <visp3/core/vpIoTools.h>
60 #include <visp3/core/vpMath.h>
61 #include <visp3/gui/vpDisplayD3D.h>
62 #include <visp3/gui/vpDisplayGDI.h>
63 #include <visp3/gui/vpDisplayGTK.h>
64 #include <visp3/gui/vpDisplayOpenCV.h>
65 #include <visp3/gui/vpDisplayX.h>
66 #include <visp3/io/vpImageIo.h>
67 #include <visp3/io/vpParseArgv.h>
68 #include <visp3/io/vpVideoReader.h>
69 #include <visp3/mbt/vpMbEdgeMultiTracker.h>
70 
71 #define GETOPTARGS "x:m:i:n:de:chtfColwvp"
72 
73 void usage(const char *name, const char *badparam)
74 {
75  fprintf(stdout, "\n\
76 Example of tracking based on the 3D model.\n\
77 \n\
78 SYNOPSIS\n\
79  %s [-i <test image path>] [-x <config file>]\n\
80  [-m <model name>] [-n <initialisation file base name>] [-e <last frame index>]\n\
81  [-t] [-c] [-d] [-h] [-f] [-C] [-o] [-w] [-l] [-v] [-p]\n", name);
82 
83  fprintf(stdout, "\n\
84 OPTIONS: \n\
85  -i <input image path> \n\
86  Set image input path.\n\
87  From this path read images \n\
88  \"mbt/cube/image%%04d.ppm\". These \n\
89  images come from ViSP-images-x.y.z.tar.gz available \n\
90  on the ViSP website.\n\
91  Setting the VISP_INPUT_IMAGE_PATH environment\n\
92  variable produces the same behavior than using\n\
93  this option.\n\
94 \n\
95  -x <config file> \n\
96  Set the config file (the xml file) to use.\n\
97  The config file is used to specify the parameters of the tracker.\n\
98 \n\
99  -m <model name> \n\
100  Specify the name of the file of the model\n\
101  The model can either be a vrml model (.wrl) or a .cao file.\n\
102 \n\
103  -e <last frame index> \n\
104  Specify the index of the last frame. Once reached, the tracking is stopped\n\
105 \n\
106  -f \n\
107  Do not use the vrml model, use the .cao one. These two models are \n\
108  equivalent and comes from ViSP-images-x.y.z.tar.gz available on the ViSP\n\
109  website. However, the .cao model allows to use the 3d model based tracker \n\
110  without Coin.\n\
111 \n\
112  -C \n\
113  Track only the cube (not the cylinder). In this case the models files are\n\
114  cube.cao or cube.wrl instead of cube_and_cylinder.cao and \n\
115  cube_and_cylinder.wrl.\n\
116 \n\
117  -n <initialisation file base name> \n\
118  Base name of the initialisation file. The file will be 'base_name'.init .\n\
119  This base name is also used for the optional picture specifying where to \n\
120  click (a .ppm picture).\n\
121 \n\
122  -t \n\
123  Turn off the display of the the moving edges. \n\
124 \n\
125  -d \n\
126  Turn off the display.\n\
127 \n\
128  -c\n\
129  Disable the mouse click. Useful to automate the \n\
130  execution of this program without human intervention.\n\
131 \n\
132  -o\n\
133  Use Ogre3D for visibility tests.\n\
134 \n\
135  -w\n\
136  When Ogre3D is enable [-o] show Ogre3D configuration dialog that allows to set the renderer.\n\
137 \n\
138  -l\n\
139  Use the scanline for visibility tests.\n\
140 \n\
141  -v\n\
142  Compute covariance matrix.\n\
143 \n\
144  -p\n\
145  Compute gradient projection error.\n\
146 \n\
147  -h \n\
148  Print the help.\n\n");
149 
150  if (badparam)
151  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
152 }
153 
154 bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile,
155  std::string &initFile, long &lastFrame, bool &displayFeatures, bool &click_allowed, bool &display,
156  bool &cao3DModel, bool &trackCylinder, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline,
157  bool &computeCovariance, bool &projectionError)
158 {
159  const char *optarg_;
160  int c;
161  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
162 
163  switch (c) {
164  case 'e':
165  lastFrame = atol(optarg_);
166  break;
167  case 'i':
168  ipath = optarg_;
169  break;
170  case 'x':
171  configFile = optarg_;
172  break;
173  case 'm':
174  modelFile = optarg_;
175  break;
176  case 'n':
177  initFile = optarg_;
178  break;
179  case 't':
180  displayFeatures = false;
181  break;
182  case 'f':
183  cao3DModel = true;
184  break;
185  case 'c':
186  click_allowed = false;
187  break;
188  case 'd':
189  display = false;
190  break;
191  case 'C':
192  trackCylinder = false;
193  break;
194  case 'o':
195  useOgre = true;
196  break;
197  case 'l':
198  useScanline = true;
199  break;
200  case 'w':
201  showOgreConfigDialog = true;
202  break;
203  case 'v':
204  computeCovariance = true;
205  break;
206  case 'p':
207  projectionError = true;
208  break;
209  case 'h':
210  usage(argv[0], NULL);
211  return false;
212  break;
213 
214  default:
215  usage(argv[0], optarg_);
216  return false;
217  break;
218  }
219  }
220 
221  if ((c == 1) || (c == -1)) {
222  // standalone param or error
223  usage(argv[0], NULL);
224  std::cerr << "ERROR: " << std::endl;
225  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
226  return false;
227  }
228 
229  return true;
230 }
231 
232 int main(int argc, const char **argv)
233 {
234  try {
235  std::string env_ipath;
236  std::string opt_ipath;
237  std::string ipath;
238  std::string opt_configFile;
239  std::string configFile;
240  std::string opt_modelFile;
241  std::string modelFile;
242  std::string opt_initFile;
243  std::string initFile;
244  long opt_lastFrame = -1;
245  bool displayFeatures = true;
246  bool opt_click_allowed = true;
247  bool opt_display = true;
248  bool cao3DModel = false;
249  bool trackCylinder = true;
250  bool useOgre = false;
251  bool showOgreConfigDialog = false;
252  bool useScanline = false;
253  bool computeCovariance = false;
254  bool projectionError = false;
255  bool quit = false;
256 
257  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH
258  // environment variable value
259  env_ipath = vpIoTools::getViSPImagesDataPath();
260 
261  // Set the default input path
262  if (!env_ipath.empty())
263  ipath = env_ipath;
264 
265  // Read the command line options
266  if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, opt_lastFrame, displayFeatures,
267  opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre, showOgreConfigDialog,
268  useScanline, computeCovariance, projectionError)) {
269  return (-1);
270  }
271 
272  // Test if an input path is set
273  if (opt_ipath.empty() && env_ipath.empty()) {
274  usage(argv[0], NULL);
275  std::cerr << std::endl << "ERROR:" << std::endl;
276  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " << std::endl
277  << " environment variable to specify the location of the " << std::endl
278  << " image path where test images are located." << std::endl
279  << std::endl;
280 
281  return (-1);
282  }
283 
284  // Get the option values
285  if (!opt_ipath.empty())
286  ipath = vpIoTools::createFilePath(opt_ipath, "mbt/cube/image%04d.pgm");
287  else
288  ipath = vpIoTools::createFilePath(env_ipath, "mbt/cube/image%04d.pgm");
289 
290  if (!opt_configFile.empty())
291  configFile = opt_configFile;
292  else if (!opt_ipath.empty())
293  configFile = vpIoTools::createFilePath(opt_ipath, "mbt/cube.xml");
294  else
295  configFile = vpIoTools::createFilePath(env_ipath, "mbt/cube.xml");
296 
297  if (!opt_modelFile.empty()) {
298  modelFile = opt_modelFile;
299  } else {
300  std::string modelFileCao;
301  std::string modelFileWrl;
302  if (trackCylinder) {
303  modelFileCao = "mbt/cube_and_cylinder.cao";
304  modelFileWrl = "mbt/cube_and_cylinder.wrl";
305  } else {
306  modelFileCao = "mbt/cube.cao";
307  modelFileWrl = "mbt/cube.wrl";
308  }
309 
310  if (!opt_ipath.empty()) {
311  if (cao3DModel) {
312  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
313  } else {
314 #ifdef VISP_HAVE_COIN3D
315  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl);
316 #else
317  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
318  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
319 #endif
320  }
321  } else {
322  if (cao3DModel) {
323  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
324  } else {
325 #ifdef VISP_HAVE_COIN3D
326  modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl);
327 #else
328  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
329  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
330 #endif
331  }
332  }
333  }
334 
335  if (!opt_initFile.empty())
336  initFile = opt_initFile;
337  else if (!opt_ipath.empty())
338  initFile = vpIoTools::createFilePath(opt_ipath, "mbt/cube");
339  else
340  initFile = vpIoTools::createFilePath(env_ipath, "mbt/cube");
341 
342  vpImage<unsigned char> I1, I2;
343  vpVideoReader reader;
344 
345  reader.setFileName(ipath);
346  try {
347  reader.open(I1);
348  I2 = I1;
349  } catch (...) {
350  std::cout << "Cannot open sequence: " << ipath << std::endl;
351  return -1;
352  }
353 
354  if (opt_lastFrame > 1 && opt_lastFrame < reader.getLastFrameIndex())
355  reader.setLastFrameIndex(opt_lastFrame);
356 
357  reader.acquire(I1);
358  I2 = I1;
359 
360 // initialise a display
361 #if defined VISP_HAVE_X11
362  vpDisplayX display1, display2;
363 #elif defined VISP_HAVE_GDI
364  vpDisplayGDI display1, display2;
365 #elif defined VISP_HAVE_OPENCV
366  vpDisplayOpenCV display1, display2;
367 #elif defined VISP_HAVE_D3D9
368  vpDisplayD3D display1, display2;
369 #elif defined VISP_HAVE_GTK
370  vpDisplayGTK display1, display2;
371 #else
372  opt_display = false;
373 #endif
374  if (opt_display) {
375 #if defined(VISP_HAVE_DISPLAY)
378  display1.init(I1, 100, 100, "Test tracking (Left)");
379  display2.init(I2, (int)(I1.getWidth() / vpDisplay::getDownScalingFactor(I1) + 110), 100, "Test tracking (Right)");
380 #endif
381  vpDisplay::display(I1);
382  vpDisplay::display(I2);
383  vpDisplay::flush(I1);
384  vpDisplay::flush(I2);
385  }
386 
387  vpMbEdgeMultiTracker tracker(2);
388  vpHomogeneousMatrix c1Mo, c2Mo;
389 
390  // Initialise the tracker: camera parameters, moving edge and KLT settings
391  vpCameraParameters cam1, cam2;
392 #if defined(VISP_HAVE_PUGIXML)
393  // From the xml file
394  tracker.loadConfigFile(configFile, configFile);
395 #else
396  // By setting the parameters:
397  cam1.initPersProjWithoutDistortion(547, 542, 338, 234);
398  cam2.initPersProjWithoutDistortion(547, 542, 338, 234);
399 
400  vpMe me;
401  me.setMaskSize(5);
402  me.setMaskNumber(180);
403  me.setRange(7);
404  me.setThreshold(5000);
405  me.setMu1(0.5);
406  me.setMu2(0.5);
407  me.setSampleStep(4);
408 
409  tracker.setCameraParameters(cam1, cam2);
410  tracker.setMovingEdge(me);
411 
412  // Specify the clipping to use
413  tracker.setNearClippingDistance(0.01);
414  tracker.setFarClippingDistance(0.90);
415  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
416 // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING |
417 // vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING |
418 // vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
419 #endif
420 
421  // Display the moving edges, see documentation for the signification of
422  // the colours
423  tracker.setDisplayFeatures(displayFeatures);
424 
425  // Tells if the tracker has to use Ogre3D for visibility tests
426  tracker.setOgreVisibilityTest(useOgre);
427  if (useOgre)
428  tracker.setOgreShowConfigDialog(showOgreConfigDialog);
429 
430  // Tells if the tracker has to use the scanline visibility tests
431  tracker.setScanLineVisibilityTest(useScanline);
432 
433  // Tells if the tracker has to compute the covariance matrix
434  tracker.setCovarianceComputation(computeCovariance);
435 
436  // Tells if the tracker has to compute the projection error
437  tracker.setProjectionErrorComputation(projectionError);
438 
439  // Retrieve the camera parameters from the tracker
440  tracker.getCameraParameters(cam1, cam2);
441 
442  // Set camera transformation matrices
443  std::map<std::string, vpHomogeneousMatrix> mapOfCamTrans;
444  mapOfCamTrans["Camera1"] = vpHomogeneousMatrix();
445  mapOfCamTrans["Camera2"] = vpHomogeneousMatrix();
446  tracker.setCameraTransformationMatrix(mapOfCamTrans);
447 
448  // Loop to position the cube
449  if (opt_display && opt_click_allowed) {
450  while (!vpDisplay::getClick(I1, false)) {
451  vpDisplay::display(I1);
452  vpDisplay::displayText(I1, 15, 10, "click after positioning the object", vpColor::red);
453  vpDisplay::flush(I1);
454  vpTime::wait(100);
455  }
456  }
457 
458  // Load the 3D model (either a vrml file or a .cao file)
459  tracker.loadModel(modelFile);
460 
461  // Initialise the tracker by clicking on the image
462  // This function looks for
463  // - a ./cube/cube.init file that defines the 3d coordinates (in meter,
464  // in the object basis) of the points used for the initialisation
465  // - a ./cube/cube.ppm file to display where the user have to click
466  // (optionnal, set by the third parameter)
467  if (opt_display && opt_click_allowed) {
468  tracker.initClick(I1, I2, initFile, initFile, true);
469  tracker.getPose(c1Mo, c2Mo);
470  // display the 3D model at the given pose
471  tracker.display(I1, I2, c1Mo, c2Mo, cam1, cam2, vpColor::red);
472  } else {
473  vpHomogeneousMatrix c1Moi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
474  vpHomogeneousMatrix c2Moi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
475  tracker.initFromPose(I1, I2, c1Moi, c2Moi);
476  }
477 
478  // track the model
479  tracker.track(I1, I2);
480  tracker.getPose(c1Mo, c2Mo);
481 
482  if (opt_display) {
483  vpDisplay::flush(I1);
484  vpDisplay::flush(I2);
485  }
486 
487  while (!reader.end()) {
488  // acquire a new image
489  reader.acquire(I1);
490  I2 = I1;
491 
492  // display the image
493  if (opt_display) {
494  vpDisplay::display(I1);
495  vpDisplay::display(I2);
496  }
497 
498  // Test to reset the tracker
499  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 10) {
500  std::cout << "----------Test reset tracker----------" << std::endl;
501  if (opt_display) {
502  vpDisplay::display(I1);
503  vpDisplay::display(I2);
504  }
505  tracker.resetTracker();
506 #if defined(VISP_HAVE_PUGIXML)
507  tracker.loadConfigFile(configFile, configFile);
508 #else
509  // By setting the parameters:
510  cam1.initPersProjWithoutDistortion(547, 542, 338, 234);
511  cam2.initPersProjWithoutDistortion(547, 542, 338, 234);
512 
513  vpMe me;
514  me.setMaskSize(5);
515  me.setMaskNumber(180);
516  me.setRange(7);
517  me.setThreshold(5000);
518  me.setMu1(0.5);
519  me.setMu2(0.5);
520  me.setSampleStep(4);
521 
522  tracker.setCameraParameters(cam1, cam2);
523  tracker.setMovingEdge(me);
524 
525  // Specify the clipping to use
526  tracker.setNearClippingDistance(0.01);
527  tracker.setFarClippingDistance(0.90);
528  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
529 // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING |
530 // vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING |
531 // vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
532 #endif
533  tracker.loadModel(modelFile);
534  tracker.setCameraParameters(cam1, cam2);
535  tracker.setOgreVisibilityTest(useOgre);
536  tracker.setScanLineVisibilityTest(useScanline);
537  tracker.setCovarianceComputation(computeCovariance);
538  tracker.setProjectionErrorComputation(projectionError);
539  tracker.initFromPose(I1, I2, c1Mo, c2Mo);
540  }
541 
542  // Test to set an initial pose
543  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) {
544  c1Mo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
545  c2Mo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
546  std::cout << "Test set pose" << std::endl;
547  tracker.setPose(I1, I2, c1Mo, c2Mo);
548  }
549 
550  // track the object: stop tracking from frame 40 to 50
551  if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 ||
552  reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) {
553  tracker.track(I1, I2);
554  tracker.getPose(c1Mo, c2Mo);
555  if (opt_display) {
556  // display the 3D model
557  tracker.display(I1, I2, c1Mo, c2Mo, cam1, cam2, vpColor::darkRed);
558  // display the frame
559  vpDisplay::displayFrame(I1, c1Mo, cam1, 0.05);
560  vpDisplay::displayFrame(I2, c2Mo, cam2, 0.05);
561  }
562  }
563 
564  if (opt_click_allowed) {
565  vpDisplay::displayText(I1, 10, 10, "Click to quit", vpColor::red);
566  if (vpDisplay::getClick(I1, false)) {
567  quit = true;
568  break;
569  }
570  }
571 
572  if (computeCovariance) {
573  std::cout << "Covariance matrix: \n" << tracker.getCovarianceMatrix() << std::endl << std::endl;
574  }
575 
576  if (projectionError) {
577  std::cout << "Projection error: " << tracker.getProjectionError() << std::endl << std::endl;
578  }
579 
580  if (opt_display) {
581  vpDisplay::flush(I1);
582  vpDisplay::flush(I2);
583  }
584  }
585 
586  std::cout << "Reached last frame: " << reader.getFrameIndex() << std::endl;
587 
588  if (opt_click_allowed && !quit) {
590  }
591  reader.close();
592 
593 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION >= 2)
594  // Cleanup memory allocated by Coin library used to load a vrml model in
595  // vpMbEdgeTracker::loadModel() We clean only if Coin was used.
596  if (!cao3DModel)
597  SoDB::finish();
598 #endif
599 
600  return EXIT_SUCCESS;
601  } catch (const vpException &e) {
602  std::cout << "Catch an exception: " << e << std::endl;
603  return EXIT_FAILURE;
604  }
605 }
606 
607 #elif !(defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_DISPLAY))
608 int main()
609 {
610  std::cout << "Cannot run this example: visp_mbt, visp_gui modules are required."
611  << std::endl;
612  return EXIT_SUCCESS;
613 }
614 #else
615 int main()
616 {
617  std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
618  return EXIT_SUCCESS;
619 }
620 #endif
621 
622 #else
623 int main()
624 {
625  std::cout << "Nothing to run, deprecated example." << std::endl;
626  return 0;
627 }
628 #endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
VISP_EXPORT int wait(double t0, double t)
Definition: vpTime.cpp:173
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1202
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setMaskNumber(const unsigned int &a)
Definition: vpMe.cpp:454
virtual void setDownScalingFactor(unsigned int scale)
Definition: vpDisplay.cpp:231
static const vpColor darkRed
Definition: vpColor.h:218
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:128
void setSampleStep(const double &s)
Definition: vpMe.h:278
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition: vpDisplayX.h:150
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
error that can be emited by ViSP classes.
Definition: vpException.h:71
Definition: vpMe.h:60
static void flush(const vpImage< unsigned char > &I)
long getFirstFrameIndex()
void setMu1(const double &mu_1)
Definition: vpMe.h:241
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:69
static const vpColor red
Definition: vpColor.h:217
void open(vpImage< vpRGBa > &I)
long getLastFrameIndex()
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed...
Definition: vpDisplayD3D.h:106
static std::string createFilePath(const std::string &parent, const std::string &child)
Definition: vpIoTools.cpp:1447
void setMaskSize(const unsigned int &a)
Definition: vpMe.cpp:461
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Generic class defining intrinsic camera parameters.
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
Definition: vpDisplayGTK.h:137
void acquire(vpImage< vpRGBa > &I)
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
void setMu2(const double &mu_2)
Definition: vpMe.h:248
long getFrameIndex() const
void setLastFrameIndex(const long last_frame)
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, const vpImagePoint &offset=vpImagePoint(0, 0))
unsigned int getDownScalingFactor()
Definition: vpDisplay.h:234
void setThreshold(const double &t)
Definition: vpMe.h:300
void setFileName(const std::string &filename)
void setRange(const unsigned int &r)
Definition: vpMe.h:271
unsigned int getWidth() const
Definition: vpImage.h:246
Make the complete stereo (or more) tracking of an object by using its CAD model.