Visual Servoing Platform  version 3.0.0
mbtEdgeKltTracking.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 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:dchtfColw"
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 &useScanline);
69 
70 void usage(const char *name, const char *badparam)
71 {
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>]\n\
78  [-t] [-c] [-d] [-h] [-f] [-C] [-o] [-w] [-l]",
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  \"ViSP-images/mbt/cube/image%%04d.ppm\". 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  -f \n\
102  Do not use the vrml model, use the .cao one. These two models are \n\
103  equivalent and comes from ViSP-images-x.y.z.tar.gz available on the ViSP\n\
104  website. However, the .cao model allows to use the 3d model based tracker \n\
105  without Coin.\n\
106 \n\
107  -C \n\
108  Track only the cube (not the cylinder). In this case the models files are\n\
109  cube.cao or cube.wrl instead of cube_and_cylinder.cao and \n\
110  cube_and_cylinder.wrl.\n\
111 \n\
112  -n <initialisation file base name> \n\
113  Base name of the initialisation file. The file will be 'base_name'.init .\n\
114  This base name is also used for the optionnal picture specifying where to \n\
115  click (a .ppm picture).\
116 \n\
117  -t \n\
118  Turn off the display of the the moving edges and Klt points. \n\
119 \n\
120  -d \n\
121  Turn off the display.\n\
122 \n\
123  -c\n\
124  Disable the mouse click. Useful to automaze the \n\
125  execution of this program without humain intervention.\n\
126 \n\
127  -o\n\
128  Use Ogre3D for visibility tests\n\
129 \n\
130  -w\n\
131  When Ogre3D is enable [-o] show Ogre3D configuration dialog thatallows to set the renderer.\n\
132 \n\
133  -l\n\
134  Use the scanline for visibility tests\n\
135 \n\
136  -h \n\
137  Print the help.\n\n");
138 
139  if (badparam)
140  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
141 }
142 
143 
144 bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile,
145  std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display,
146  bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline)
147 {
148  const char *optarg_;
149  int c;
150  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
151 
152  switch (c) {
153  case 'i': ipath = optarg_; break;
154  case 'x': configFile = optarg_; break;
155  case 'm': modelFile = optarg_; break;
156  case 'n': initFile = optarg_; break;
157  case 't': displayFeatures = false; break;
158  case 'f': cao3DModel = true; break;
159  case 'c': click_allowed = false; break;
160  case 'd': display = false; break;
161  case 'C': trackCylinder = false; break;
162  case 'o': useOgre = true; break;
163  case 'l': useScanline = true; break;
164  case 'w': showOgreConfigDialog = true; break;
165  case 'h': usage(argv[0], NULL); return false; break;
166 
167  default:
168  usage(argv[0], optarg_);
169  return false; break;
170  }
171  }
172 
173  if ((c == 1) || (c == -1)) {
174  // standalone param or error
175  usage(argv[0], NULL);
176  std::cerr << "ERROR: " << std::endl;
177  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
178  return false;
179  }
180 
181  return true;
182 }
183 
184 int
185 main(int argc, const char ** argv)
186 {
187  try {
188  std::string env_ipath;
189  std::string opt_ipath;
190  std::string ipath;
191  std::string opt_configFile;
192  std::string configFile;
193  std::string opt_modelFile;
194  std::string modelFile;
195  std::string opt_initFile;
196  std::string initFile;
197  bool displayFeatures = true;
198  bool opt_click_allowed = true;
199  bool opt_display = true;
200  bool cao3DModel = false;
201  bool trackCylinder = true;
202  bool useOgre = false;
203  bool showOgreConfigDialog = false;
204  bool useScanline = false;
205  bool quit = false;
206 
207  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value
208  env_ipath = vpIoTools::getViSPImagesDataPath();
209 
210  // Set the default input path
211  if (! env_ipath.empty())
212  ipath = env_ipath;
213 
214  // Read the command line options
215  if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures,
216  opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre, showOgreConfigDialog,
217  useScanline)) {
218  return (-1);
219  }
220 
221  // Test if an input path is set
222  if (opt_ipath.empty() && env_ipath.empty() ){
223  usage(argv[0], NULL);
224  std::cerr << std::endl
225  << "ERROR:" << std::endl;
226  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH "
227  << std::endl
228  << " environment variable to specify the location of the " << std::endl
229  << " image path where test images are located." << std::endl
230  << std::endl;
231 
232  return (-1);
233  }
234 
235  // Get the option values
236  if (!opt_ipath.empty())
237  ipath = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube/image%04d.pgm");
238  else
239  ipath = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube/image%04d.pgm");
240 
241  if (!opt_configFile.empty())
242  configFile = opt_configFile;
243  else if (!opt_ipath.empty())
244  configFile = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube.xml");
245  else
246  configFile = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.xml");
247 
248  if (!opt_modelFile.empty()){
249  modelFile = opt_modelFile;
250  }else{
251  std::string modelFileCao;
252  std::string modelFileWrl;
253  if(trackCylinder){
254  modelFileCao = "ViSP-images/mbt/cube_and_cylinder.cao";
255  modelFileWrl = "ViSP-images/mbt/cube_and_cylinder.wrl";
256  }else{
257  modelFileCao = "ViSP-images/mbt/cube.cao";
258  modelFileWrl = "ViSP-images/mbt/cube.wrl";
259  }
260 
261  if(!opt_ipath.empty()){
262  if(cao3DModel){
263  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
264  }
265  else{
266 #ifdef VISP_HAVE_COIN3D
267  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl);
268 #else
269  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
270  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
271 #endif
272  }
273  }
274  else{
275  if(cao3DModel){
276  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
277  }
278  else{
279 #ifdef VISP_HAVE_COIN3D
280  modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl);
281 #else
282  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
283  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
284 #endif
285  }
286  }
287  }
288 
289  if (!opt_initFile.empty())
290  initFile = opt_initFile;
291  else if (!opt_ipath.empty())
292  initFile = vpIoTools::createFilePath(opt_ipath, "ViSP-images/mbt/cube");
293  else
294  initFile = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube");
295 
297  vpVideoReader reader;
298 
299  reader.setFileName(ipath);
300  try{
301  reader.open(I);
302  }catch(...){
303  std::cout << "Cannot open sequence: " << ipath << std::endl;
304  return -1;
305  }
306 
307  reader.acquire(I);
308 
309  // initialise a display
310 #if defined VISP_HAVE_X11
311  vpDisplayX display;
312 #elif defined VISP_HAVE_GDI
313  vpDisplayGDI display;
314 #elif defined VISP_HAVE_OPENCV
315  vpDisplayOpenCV display;
316 #elif defined VISP_HAVE_D3D9
317  vpDisplayD3D display;
318 #elif defined VISP_HAVE_GTK
319  vpDisplayGTK display;
320 #else
321  opt_display = false;
322 #endif
323  if (opt_display)
324  {
325 #if (defined VISP_HAVE_DISPLAY)
326  display.init(I, 100, 100, "Test tracking") ;
327 #endif
328  vpDisplay::display(I) ;
329  vpDisplay::flush(I);
330  }
331 
332  vpMbEdgeKltTracker tracker;
334  vpCameraParameters cam;
335 
336  // Initialise the tracker: camera parameters, moving edge and KLT settings
337 #if defined (VISP_HAVE_XML2)
338  // From the xml file
339  tracker.loadConfigFile(configFile);
340 #else
341  // By setting the parameters:
342  cam.initPersProjWithoutDistortion(547, 542, 338, 234);
343 
344  vpMe me;
345  me.setMaskSize(5);
346  me.setMaskNumber(180);
347  me.setRange(7);
348  me.setThreshold(5000);
349  me.setMu1(0.5);
350  me.setMu2(0.5);
351  me.setSampleStep(4);
352 
353  vpKltOpencv klt;
354  klt.setMaxFeatures(10000);
355  klt.setWindowSize(5);
356  klt.setQuality(0.01);
357  klt.setMinDistance(5);
358  klt.setHarrisFreeParameter(0.01);
359  klt.setBlockSize(3);
360  klt.setPyramidLevels(3);
361 
362  tracker.setCameraParameters(cam);
363  tracker.setMovingEdge(me);
364  tracker.setKltOpencv(klt);
365  tracker.setAngleAppear( vpMath::rad(65) );
366  tracker.setAngleDisappear( vpMath::rad(75) );
367  tracker.setMaskBorder(5);
368 
369  // Specify the clipping to
370  tracker.setNearClippingDistance(0.01);
371  tracker.setFarClippingDistance(0.90);
373  // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING | vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING | vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
374 #endif
375 
376  // Display the moving edges, and the Klt points
377  tracker.setDisplayFeatures(displayFeatures);
378 
379  // Tells if the tracker has to use Ogre3D for visibility tests
380  tracker.setOgreVisibilityTest(useOgre);
381  if (useOgre)
382  tracker.setOgreShowConfigDialog(showOgreConfigDialog);
383 
384  // Tells if the tracker has to use the scanline visibility tests
385  tracker.setScanLineVisibilityTest(useScanline);
386 
387  // Retrieve the camera parameters from the tracker
388  tracker.getCameraParameters(cam);
389 
390  // Loop to position the cube
391  if (opt_display && opt_click_allowed)
392  {
393  while(!vpDisplay::getClick(I,false)){
395  vpDisplay::displayText(I, 15, 10, "click after positioning the object", vpColor::red);
396  vpDisplay::flush(I) ;
397  }
398  }
399 
400  // Load the 3D model (either a vrml file or a .cao file)
401  tracker.loadModel(modelFile);
402 
403  // Initialise the tracker by clicking on the image
404  // This function looks for
405  // - a ./cube/cube.init file that defines the 3d coordinates (in meter, in the object basis) of the points used for the initialisation
406  // - a ./cube/cube.ppm file to display where the user have to click (optionnal, set by the third parameter)
407  if (opt_display && opt_click_allowed)
408  {
409  tracker.initClick(I, initFile, true);
410  tracker.getPose(cMo);
411  // display the 3D model at the given pose
412  tracker.display(I,cMo, cam, vpColor::red);
413  }
414  else
415  {
416  vpHomogeneousMatrix cMoi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
417  tracker.initFromPose(I, cMoi);
418  }
419 
420  //track the model
421  tracker.track(I);
422  tracker.getPose(cMo);
423 
424  if (opt_display)
425  vpDisplay::flush(I);
426 
427  // Uncomment if you want to compute the covariance matrix.
428  // tracker.setCovarianceComputation(true); //Important if you want tracker.getCovarianceMatrix() to work.
429 
430  while (!reader.end())
431  {
432  // acquire a new image
433  reader.acquire(I);
434  // display the image
435  if (opt_display)
437 
438  // Test to reset the tracker
439  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 10) {
440  vpTRACE("Test reset tracker");
441  if (opt_display)
443  tracker.resetTracker();
444 #if defined (VISP_HAVE_XML2)
445  tracker.loadConfigFile(configFile);
446 #else
447  // By setting the parameters:
448  cam.initPersProjWithoutDistortion(547, 542, 338, 234);
449 
450  vpMe me;
451  me.setMaskSize(5);
452  me.setMaskNumber(180);
453  me.setRange(7);
454  me.setThreshold(5000);
455  me.setMu1(0.5);
456  me.setMu2(0.5);
457  me.setSampleStep(4);
458 
459  vpKltOpencv klt;
460  klt.setMaxFeatures(10000);
461  klt.setWindowSize(5);
462  klt.setQuality(0.01);
463  klt.setMinDistance(5);
464  klt.setHarrisFreeParameter(0.01);
465  klt.setBlockSize(3);
466  klt.setPyramidLevels(3);
467 
468  tracker.setCameraParameters(cam);
469  tracker.setMovingEdge(me);
470  tracker.setKltOpencv(klt);
471  tracker.setAngleAppear( vpMath::rad(65) );
472  tracker.setAngleDisappear( vpMath::rad(75) );
473  tracker.setMaskBorder(5);
474 
475  // Specify the clipping to
476  tracker.setNearClippingDistance(0.01);
477  tracker.setFarClippingDistance(0.90);
479  // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING | vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING | vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
480 #endif
481  tracker.loadModel(modelFile);
482  tracker.setCameraParameters(cam);
483  tracker.setOgreVisibilityTest(useOgre);
484  tracker.setScanLineVisibilityTest(useScanline);
485  tracker.initFromPose(I, cMo);
486  }
487 
488  // Test to set an initial pose
489  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) {
490  cMo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
491  vpTRACE("Test set pose");
492  tracker.setPose(I, cMo);
493 // if (opt_display) {
494 // // display the 3D model
495 // tracker.display(I, cMo, cam, vpColor::darkRed);
496 // // display the frame
497 // vpDisplay::displayFrame (I, cMo, cam, 0.05);
502 // }
503  }
504 
505  // track the object: stop tracking from frame 40 to 50
506  if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) {
507  tracker.track(I);
508  tracker.getPose(cMo);
509  if (opt_display) {
510  // display the 3D model
511  tracker.display(I, cMo, cam, vpColor::darkRed);
512  // display the frame
513  vpDisplay::displayFrame (I, cMo, cam, 0.05);
514  }
515  }
516 
517  if (opt_click_allowed) {
518  vpDisplay::displayText(I, 10, 10, "Click to quit", vpColor::red);
519  if (vpDisplay::getClick(I, false)) {
520  quit = true;
521  break;
522  }
523  }
524 
525  // Uncomment if you want to print the covariance matrix.
526  // Make sure tracker.setCovarianceComputation(true) has been called (uncomment below).
527  // std::cout << tracker.getCovarianceMatrix() << std::endl << std::endl;
528 
529  vpDisplay::flush(I) ;
530  }
531  if (opt_click_allowed && !quit) {
533  }
534  reader.close();
535 
536 #if defined (VISP_HAVE_XML2)
537  // Cleanup memory allocated by xml library used to parse the xml config file in vpMbEdgeKltTracker::loadConfigFile()
539 #endif
540 
541 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3)
542  // Cleanup memory allocated by Coin library used to load a vrml model in vpMbEdgeKltTracker::loadModel()
543  // We clean only if Coin was used.
544  if(! cao3DModel)
545  SoDB::finish();
546 #endif
547 
548  return 0;
549  }
550  catch(vpException e) {
551  std::cout << "Catch an exception: " << e << std::endl;
552  return 1;
553  }
554 }
555 
556 #else
557 
558 int main()
559 {
560  std::cout << "visp_mbt, visp_gui modules and OpenCV are required to run this example." << std::endl;
561  return 0;
562 }
563 
564 #endif
void setKltOpencv(const vpKltOpencv &t)
void setMovingEdge(const vpMe &me)
long getFrameIndex() const
long getFirstFrameIndex() const
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1091
virtual void setScanLineVisibilityTest(const bool &v)
void setHarrisFreeParameter(double harris_k)
virtual unsigned int getClipping() const
Definition: vpMbTracker.h:232
virtual void setAngleDisappear(const double &a)
Definition: vpMbTracker.h:430
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setMaskNumber(const unsigned int &a)
Definition: vpMe.cpp:460
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:260
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Definition: vpDisplay.cpp:888
Define the X11 console to display images.
Definition: vpDisplayX.h:148
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
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
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)
Definition: vpDisplay.cpp:2233
virtual void setFarClippingDistance(const double &dist)
void setMu1(const double &mu_1)
Definition: vpMe.h:160
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:523
void open(vpImage< vpRGBa > &I)
virtual void setOgreVisibilityTest(const bool &v)
Display for windows using Direct3D.
Definition: vpDisplayD3D.h:105
void setMaskSize(const unsigned int &a)
Definition: vpMe.cpp:468
void getPose(vpHomogeneousMatrix &cMo_) const
Definition: vpMbTracker.h:356
#define vpTRACE
Definition: vpDebug.h:414
static std::string createFilePath(const std::string &parent, const std::string child)
Definition: vpIoTools.cpp:1265
static void display(const vpImage< unsigned char > &I)
Definition: vpDisplay.cpp:206
The vpDisplayOpenCV allows to display image using the opencv library.
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:225
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)
Generic class defining intrinsic camera parameters.
The vpDisplayGTK allows to display image using the GTK+ library version 1.2.
Definition: vpDisplayGTK.h:141
void acquire(vpImage< vpRGBa > &I)
void setFileName(const char *filename)
virtual void setAngleAppear(const double &a)
Definition: vpMbTracker.h:419
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)
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))
Definition: vpDisplay.cpp:373
static void cleanup()
Definition: vpXmlParser.h:216
void setMu2(const double &mu_2)
Definition: vpMe.h:174
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.
Definition: vpKltOpencv.h:75
void setBlockSize(const int blockSize)
void setThreshold(const double &t)
Definition: vpMe.h:288
virtual bool getClick(bool blocking=true)=0
void setDisplayFeatures(const bool displayF)
Definition: vpMbTracker.h:459
void setRange(const unsigned int &r)
Definition: vpMe.h:218
virtual void setNearClippingDistance(const double &dist)