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