Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mbtEdgeKltTracking.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Example of Hybrid Tracking of MBT and MBT KTL.
32  *
33  * Authors:
34  * Aurelien Yol
35  *
36  *****************************************************************************/
37 
44 #include <iostream>
45 #include <visp3/core/vpConfig.h>
46 
47 #if defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
48 
49 #include <visp3/core/vpDebug.h>
50 #include <visp3/gui/vpDisplayD3D.h>
51 #include <visp3/gui/vpDisplayGTK.h>
52 #include <visp3/gui/vpDisplayGDI.h>
53 #include <visp3/gui/vpDisplayOpenCV.h>
54 #include <visp3/gui/vpDisplayX.h>
55 #include <visp3/core/vpHomogeneousMatrix.h>
56 #include <visp3/io/vpImageIo.h>
57 #include <visp3/core/vpIoTools.h>
58 #include <visp3/core/vpMath.h>
59 #include <visp3/io/vpVideoReader.h>
60 #include <visp3/io/vpParseArgv.h>
61 #include <visp3/mbt/vpMbEdgeKltTracker.h>
62 
63 #define GETOPTARGS "x:m:i:n:dchtfColwvp"
64 
65 void usage(const char *name, const char *badparam);
66 bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile,
67  std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display,
68  bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &showOgreConfigDialog,
69  bool &useScanline, bool &computeCovariance, bool &projectionError);
70 
71 void usage(const char *name, const char *badparam)
72 {
73  fprintf(stdout, "\n\
74 Example of tracking based on the 3D model.\n\
75 \n\
76 SYNOPSIS\n\
77  %s [-i <test image path>] [-x <config file>]\n\
78  [-m <model name>] [-n <initialisation file base name>]\n\
79  [-t] [-c] [-d] [-h] [-f] [-C] [-o] [-w] [-l] [-v] [-p]",
80  name );
81 
82  fprintf(stdout, "\n\
83 OPTIONS: \n\
84  -i <input image path> \n\
85  Set image input path.\n\
86  From this path read images \n\
87  \"ViSP-images/mbt/cube/image%%04d.ppm\". These \n\
88  images come from ViSP-images-x.y.z.tar.gz available \n\
89  on the ViSP website.\n\
90  Setting the VISP_INPUT_IMAGE_PATH environment\n\
91  variable produces the same behaviour than using\n\
92  this option.\n\
93 \n\
94  -x <config file> \n\
95  Set the config file (the xml file) to use.\n\
96  The config file is used to specify the parameters of the tracker.\n\
97 \n\
98  -m <model name> \n\
99  Specify the name of the file of the model\n\
100  The model can either be a vrml model (.wrl) or a .cao file.\n\
101 \n\
102  -f \n\
103  Do not use the vrml model, use the .cao one. These two models are \n\
104  equivalent and comes from ViSP-images-x.y.z.tar.gz available on the ViSP\n\
105  website. However, the .cao model allows to use the 3d model based tracker \n\
106  without Coin.\n\
107 \n\
108  -C \n\
109  Track only the cube (not the cylinder). In this case the models files are\n\
110  cube.cao or cube.wrl instead of cube_and_cylinder.cao and \n\
111  cube_and_cylinder.wrl.\n\
112 \n\
113  -n <initialisation file base name> \n\
114  Base name of the initialisation file. The file will be 'base_name'.init .\n\
115  This base name is also used for the optionnal picture specifying where to \n\
116  click (a .ppm picture).\
117 \n\
118  -t \n\
119  Turn off the display of the the moving edges and Klt points. \n\
120 \n\
121  -d \n\
122  Turn off the display.\n\
123 \n\
124  -c\n\
125  Disable the mouse click. Useful to automaze the \n\
126  execution of this program without humain intervention.\n\
127 \n\
128  -o\n\
129  Use Ogre3D for visibility tests\n\
130 \n\
131  -w\n\
132  When Ogre3D is enable [-o] show Ogre3D configuration dialog thatallows to set the renderer.\n\
133 \n\
134  -l\n\
135  Use the scanline for visibility tests.\n\
136 \n\
137  -v\n\
138  Compute covariance matrix.\n\
139 \n\
140  -v\n\
141  Compute gradient projection error.\n\
142 \n\
143  -h \n\
144  Print the help.\n\n");
145 
146  if (badparam)
147  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
148 }
149 
150 
151 bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile,
152  std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display,
153  bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &showOgreConfigDialog,
154  bool &useScanline, bool &computeCovariance, bool &projectionError)
155 {
156  const char *optarg_;
157  int c;
158  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
159 
160  switch (c) {
161  case 'i': ipath = optarg_; break;
162  case 'x': configFile = optarg_; break;
163  case 'm': modelFile = optarg_; break;
164  case 'n': initFile = optarg_; break;
165  case 't': displayFeatures = false; break;
166  case 'f': cao3DModel = true; break;
167  case 'c': click_allowed = false; break;
168  case 'd': display = false; break;
169  case 'C': trackCylinder = false; break;
170  case 'o': useOgre = true; break;
171  case 'l': useScanline = true; break;
172  case 'w': showOgreConfigDialog = true; break;
173  case 'v': computeCovariance = true; break;
174  case 'p': projectionError = true; break;
175  case 'h': usage(argv[0], NULL); return false; break;
176 
177  default:
178  usage(argv[0], optarg_);
179  return false; break;
180  }
181  }
182 
183  if ((c == 1) || (c == -1)) {
184  // standalone param or error
185  usage(argv[0], NULL);
186  std::cerr << "ERROR: " << std::endl;
187  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
188  return false;
189  }
190 
191  return true;
192 }
193 
194 int
195 main(int argc, const char ** argv)
196 {
197  try {
198  std::string env_ipath;
199  std::string opt_ipath;
200  std::string ipath;
201  std::string opt_configFile;
202  std::string configFile;
203  std::string opt_modelFile;
204  std::string modelFile;
205  std::string opt_initFile;
206  std::string initFile;
207  bool displayFeatures = true;
208  bool opt_click_allowed = true;
209  bool opt_display = true;
210  bool cao3DModel = false;
211  bool trackCylinder = true;
212  bool useOgre = false;
213  bool showOgreConfigDialog = false;
214  bool useScanline = false;
215  bool computeCovariance = false;
216  bool projectionError = false;
217  bool quit = false;
218 
219  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value
220  env_ipath = vpIoTools::getViSPImagesDataPath();
221 
222  // Set the default input path
223  if (! env_ipath.empty())
224  ipath = env_ipath;
225 
226  // Read the command line options
227  if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures,
228  opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre, showOgreConfigDialog,
229  useScanline, computeCovariance, projectionError)) {
230  return (-1);
231  }
232 
233  // Test if an input path is set
234  if (opt_ipath.empty() && env_ipath.empty() ){
235  usage(argv[0], NULL);
236  std::cerr << std::endl
237  << "ERROR:" << std::endl;
238  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH "
239  << std::endl
240  << " environment variable to specify the location of the " << std::endl
241  << " image path where test images are located." << std::endl
242  << std::endl;
243 
244  return (-1);
245  }
246 
247  // Get the option values
248  if (!opt_ipath.empty())
249  ipath = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube/image%04d.pgm");
250  else
251  ipath = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube/image%04d.pgm");
252 
253  if (!opt_configFile.empty())
254  configFile = opt_configFile;
255  else if (!opt_ipath.empty())
256  configFile = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube.xml");
257  else
258  configFile = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.xml");
259 
260  if (!opt_modelFile.empty()){
261  modelFile = opt_modelFile;
262  }else{
263  std::string modelFileCao;
264  std::string modelFileWrl;
265  if(trackCylinder){
266  modelFileCao = "ViSP-images/mbt/cube_and_cylinder.cao";
267  modelFileWrl = "ViSP-images/mbt/cube_and_cylinder.wrl";
268  }else{
269  modelFileCao = "ViSP-images/mbt/cube.cao";
270  modelFileWrl = "ViSP-images/mbt/cube.wrl";
271  }
272 
273  if(!opt_ipath.empty()){
274  if(cao3DModel){
275  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
276  }
277  else{
278 #ifdef VISP_HAVE_COIN3D
279  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl);
280 #else
281  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
282  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
283 #endif
284  }
285  }
286  else{
287  if(cao3DModel){
288  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
289  }
290  else{
291 #ifdef VISP_HAVE_COIN3D
292  modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl);
293 #else
294  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
295  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
296 #endif
297  }
298  }
299  }
300 
301  if (!opt_initFile.empty())
302  initFile = opt_initFile;
303  else if (!opt_ipath.empty())
304  initFile = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube");
305  else
306  initFile = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube");
307 
309  vpVideoReader reader;
310 
311  reader.setFileName(ipath);
312  try{
313  reader.open(I);
314  }catch(...){
315  std::cout << "Cannot open sequence: " << ipath << std::endl;
316  return -1;
317  }
318 
319  reader.acquire(I);
320 
321  // initialise a display
322 #if defined VISP_HAVE_X11
323  vpDisplayX display;
324 #elif defined VISP_HAVE_GDI
325  vpDisplayGDI display;
326 #elif defined VISP_HAVE_OPENCV
327  vpDisplayOpenCV display;
328 #elif defined VISP_HAVE_D3D9
329  vpDisplayD3D display;
330 #elif defined VISP_HAVE_GTK
331  vpDisplayGTK display;
332 #else
333  opt_display = false;
334 #endif
335  if (opt_display)
336  {
337 #if (defined VISP_HAVE_DISPLAY)
338  display.init(I, 100, 100, "Test tracking") ;
339 #endif
340  vpDisplay::display(I) ;
341  vpDisplay::flush(I);
342  }
343 
344  vpMbEdgeKltTracker tracker;
346  vpCameraParameters cam;
347 
348  // Initialise the tracker: camera parameters, moving edge and KLT settings
349 #if defined (VISP_HAVE_XML2)
350  // From the xml file
351  tracker.loadConfigFile(configFile);
352 #else
353  // By setting the parameters:
354  cam.initPersProjWithoutDistortion(547, 542, 338, 234);
355 
356  vpMe me;
357  me.setMaskSize(5);
358  me.setMaskNumber(180);
359  me.setRange(7);
360  me.setThreshold(5000);
361  me.setMu1(0.5);
362  me.setMu2(0.5);
363  me.setSampleStep(4);
364 
365  vpKltOpencv klt;
366  klt.setMaxFeatures(10000);
367  klt.setWindowSize(5);
368  klt.setQuality(0.01);
369  klt.setMinDistance(5);
370  klt.setHarrisFreeParameter(0.01);
371  klt.setBlockSize(3);
372  klt.setPyramidLevels(3);
373 
374  tracker.setCameraParameters(cam);
375  tracker.setMovingEdge(me);
376  tracker.setKltOpencv(klt);
377  tracker.setAngleAppear( vpMath::rad(65) );
378  tracker.setAngleDisappear( vpMath::rad(75) );
379  tracker.setMaskBorder(5);
380 
381  // Specify the clipping to
382  tracker.setNearClippingDistance(0.01);
383  tracker.setFarClippingDistance(0.90);
385  // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING | vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING | vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
386 #endif
387 
388  // Display the moving edges, and the Klt points
389  tracker.setDisplayFeatures(displayFeatures);
390 
391  // Tells if the tracker has to use Ogre3D for visibility tests
392  tracker.setOgreVisibilityTest(useOgre);
393  if (useOgre)
394  tracker.setOgreShowConfigDialog(showOgreConfigDialog);
395 
396  // Tells if the tracker has to use the scanline visibility tests
397  tracker.setScanLineVisibilityTest(useScanline);
398 
399  // Tells if the tracker has to compute the covariance matrix
400  tracker.setCovarianceComputation(computeCovariance);
401 
402  // Tells if the tracker has to compute the projection error
403  tracker.setProjectionErrorComputation(projectionError);
404 
405  // Retrieve the camera parameters from the tracker
406  tracker.getCameraParameters(cam);
407 
408  // Loop to position the cube
409  if (opt_display && opt_click_allowed)
410  {
411  while(!vpDisplay::getClick(I,false)){
413  vpDisplay::displayText(I, 15, 10, "click after positioning the object", vpColor::red);
414  vpDisplay::flush(I);
415  vpTime::wait(100);
416  }
417  }
418 
419  // Load the 3D model (either a vrml file or a .cao file)
420  tracker.loadModel(modelFile);
421 
422  // Initialise the tracker by clicking on the image
423  // This function looks for
424  // - a ./cube/cube.init file that defines the 3d coordinates (in meter, in the object basis) of the points used for the initialisation
425  // - a ./cube/cube.ppm file to display where the user have to click (optionnal, set by the third parameter)
426  if (opt_display && opt_click_allowed)
427  {
428  tracker.initClick(I, initFile, true);
429  tracker.getPose(cMo);
430  // display the 3D model at the given pose
431  tracker.display(I,cMo, cam, vpColor::red);
432  }
433  else
434  {
435  vpHomogeneousMatrix cMoi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
436  tracker.initFromPose(I, cMoi);
437  }
438 
439  //track the model
440  tracker.track(I);
441  tracker.getPose(cMo);
442 
443  if (opt_display)
444  vpDisplay::flush(I);
445 
446  while (!reader.end())
447  {
448  // acquire a new image
449  reader.acquire(I);
450  // display the image
451  if (opt_display)
453 
454  // Test to reset the tracker
455  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 10) {
456  vpTRACE("Test reset tracker");
457  if (opt_display)
459  tracker.resetTracker();
460 #if defined (VISP_HAVE_XML2)
461  tracker.loadConfigFile(configFile);
462 #else
463  // By setting the parameters:
464  cam.initPersProjWithoutDistortion(547, 542, 338, 234);
465 
466  vpMe me;
467  me.setMaskSize(5);
468  me.setMaskNumber(180);
469  me.setRange(7);
470  me.setThreshold(5000);
471  me.setMu1(0.5);
472  me.setMu2(0.5);
473  me.setSampleStep(4);
474 
475  vpKltOpencv klt;
476  klt.setMaxFeatures(10000);
477  klt.setWindowSize(5);
478  klt.setQuality(0.01);
479  klt.setMinDistance(5);
480  klt.setHarrisFreeParameter(0.01);
481  klt.setBlockSize(3);
482  klt.setPyramidLevels(3);
483 
484  tracker.setCameraParameters(cam);
485  tracker.setMovingEdge(me);
486  tracker.setKltOpencv(klt);
487  tracker.setAngleAppear( vpMath::rad(65) );
488  tracker.setAngleDisappear( vpMath::rad(75) );
489  tracker.setMaskBorder(5);
490 
491  // Specify the clipping to
492  tracker.setNearClippingDistance(0.01);
493  tracker.setFarClippingDistance(0.90);
495  // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING | vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING | vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
496 #endif
497  tracker.loadModel(modelFile);
498  tracker.setCameraParameters(cam);
499  tracker.setOgreVisibilityTest(useOgre);
500  tracker.setScanLineVisibilityTest(useScanline);
501  tracker.setCovarianceComputation(computeCovariance);
502  tracker.setProjectionErrorComputation(projectionError);
503  tracker.initFromPose(I, cMo);
504  }
505 
506  // Test to set an initial pose
507  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) {
508  cMo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
509  vpTRACE("Test set pose");
510  tracker.setPose(I, cMo);
511 // if (opt_display) {
512 // // display the 3D model
513 // tracker.display(I, cMo, cam, vpColor::darkRed);
514 // // display the frame
515 // vpDisplay::displayFrame (I, cMo, cam, 0.05);
520 // }
521  }
522 
523  // track the object: stop tracking from frame 40 to 50
524  if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) {
525  tracker.track(I);
526  tracker.getPose(cMo);
527  if (opt_display) {
528  // display the 3D model
529  tracker.display(I, cMo, cam, vpColor::darkRed);
530  // display the frame
531  vpDisplay::displayFrame (I, cMo, cam, 0.05);
532  }
533  }
534 
535  if (opt_click_allowed) {
536  vpDisplay::displayText(I, 10, 10, "Click to quit", vpColor::red);
537  if (vpDisplay::getClick(I, false)) {
538  quit = true;
539  break;
540  }
541  }
542 
543  if(computeCovariance) {
544  std::cout << "Covariance matrix: \n" << tracker.getCovarianceMatrix() << std::endl << std::endl;
545  }
546 
547  if(projectionError) {
548  std::cout << "Projection error: " << tracker.getProjectionError() << std::endl << std::endl;
549  }
550 
551  vpDisplay::flush(I) ;
552  }
553  if (opt_click_allowed && !quit) {
555  }
556  reader.close();
557 
558 #if defined (VISP_HAVE_XML2)
559  // Cleanup memory allocated by xml library used to parse the xml config file in vpMbEdgeKltTracker::loadConfigFile()
561 #endif
562 
563 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3)
564  // Cleanup memory allocated by Coin library used to load a vrml model in vpMbEdgeKltTracker::loadModel()
565  // We clean only if Coin was used.
566  if(! cao3DModel)
567  SoDB::finish();
568 #endif
569 
570  return 0;
571  }
572  catch(vpException &e) {
573  std::cout << "Catch an exception: " << e << std::endl;
574  return 1;
575  }
576 }
577 
578 #else
579 
580 int main()
581 {
582  std::cout << "visp_mbt, visp_gui modules and OpenCV are required to run this example." << std::endl;
583  return 0;
584 }
585 
586 #endif
virtual void setKltOpencv(const vpKltOpencv &t)
virtual void setDisplayFeatures(const bool displayF)
Definition: vpMbTracker.h:411
virtual void setCovarianceComputation(const bool &flag)
Definition: vpMbTracker.h:398
void setMovingEdge(const vpMe &me)
VISP_EXPORT int wait(double t0, double t)
Definition: vpTime.cpp:157
long getFrameIndex() const
long getFirstFrameIndex() const
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1157
virtual void setScanLineVisibilityTest(const bool &v)
void setHarrisFreeParameter(double harris_k)
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:208
virtual void setAngleDisappear(const double &a)
Definition: vpMbTracker.h:382
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setMaskNumber(const unsigned int &a)
Definition: vpMe.cpp:488
static const vpColor darkRed
Definition: vpColor.h:164
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:128
void setMaxFeatures(const int maxCount)
void setSampleStep(const double &s)
Definition: vpMe.h:263
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition: vpDisplayX.h:153
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
void setMinDistance(double minDistance)
error that can be emited by ViSP classes.
Definition: vpException.h:73
Definition: vpMe.h:59
virtual void setClipping(const unsigned int &flags)
virtual void initFromPose(const vpImage< unsigned char > &I, const std::string &initFile)
static void flush(const vpImage< unsigned char > &I)
virtual void setFarClippingDistance(const double &dist)
void setMu1(const double &mu_1)
Definition: vpMe.h:226
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:76
static const vpColor red
Definition: vpColor.h:163
void setQuality(double qualityLevel)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void setOgreShowConfigDialog(const bool showConfigDialog)
Definition: vpMbTracker.h:479
void open(vpImage< vpRGBa > &I)
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:107
void setMaskSize(const unsigned int &a)
Definition: vpMe.cpp:496
virtual void setProjectionErrorComputation(const bool &flag)
#define vpTRACE
Definition: vpDebug.h:414
static std::string createFilePath(const std::string &parent, const std::string child)
Definition: vpIoTools.cpp:1366
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 void getCameraParameters(vpCameraParameters &camera) const
Definition: vpMbTracker.h:201
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)
virtual double getProjectionError() const
Definition: vpMbTracker.h:226
Generic class defining intrinsic camera parameters.
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
Definition: vpDisplayGTK.h:138
void acquire(vpImage< vpRGBa > &I)
void setFileName(const char *filename)
virtual void setAngleAppear(const double &a)
Definition: vpMbTracker.h:371
void loadConfigFile(const char *configFile)
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
void setPyramidLevels(const int pyrMaxLevel)
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
static double rad(double deg)
Definition: vpMath.h:104
virtual void setCameraParameters(const vpCameraParameters &cam)
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
Hybrid tracker based on moving-edges and keypoints tracked using KLT tracker.
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, vpImagePoint offset=vpImagePoint(0, 0))
static void cleanup()
Definition: vpXmlParser.h:308
void setMu2(const double &mu_2)
Definition: vpMe.h:233
void setWindowSize(const int winSize)
void setMaskBorder(const unsigned int &e)
virtual void loadModel(const char *modelFile, const bool verbose=false)
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
Definition: vpKltOpencv.h:76
virtual void getPose(vpHomogeneousMatrix &cMo_) const
Definition: vpMbTracker.h:333
void setBlockSize(const int blockSize)
void setThreshold(const double &t)
Definition: vpMe.h:284
void setRange(const unsigned int &r)
Definition: vpMe.h:256
virtual void setNearClippingDistance(const double &dist)
virtual vpMatrix getCovarianceMatrix() const
Definition: vpMbTracker.h:213