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