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