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