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