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