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