Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
mbtKltMultiTracking.cpp
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 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 http://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 MBT KLT Tracking.
33  *
34  * Authors:
35  * Aurelien Yol
36  * Souriya Trinh
37  *
38  *****************************************************************************/
39 
46 #include <iostream>
47 #include <visp3/core/vpConfig.h>
48 
49 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
50 
51 #if defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && \
52  defined(VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
53 
54 #include <visp3/core/vpDebug.h>
55 #include <visp3/core/vpHomogeneousMatrix.h>
56 #include <visp3/core/vpIoTools.h>
57 #include <visp3/core/vpMath.h>
58 #include <visp3/gui/vpDisplayD3D.h>
59 #include <visp3/gui/vpDisplayGDI.h>
60 #include <visp3/gui/vpDisplayGTK.h>
61 #include <visp3/gui/vpDisplayOpenCV.h>
62 #include <visp3/gui/vpDisplayX.h>
63 #include <visp3/io/vpImageIo.h>
64 #include <visp3/io/vpParseArgv.h>
65 #include <visp3/io/vpVideoReader.h>
66 #include <visp3/mbt/vpMbKltMultiTracker.h>
67 
68 #define GETOPTARGS "x:m:i:n:de:chtfolwv"
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>] [-e <last frame index>] \n\
78  [-t] [-c] [-d] [-h] [-f] [-o] [-w] [-l] [-v]\n", name);
79 
80  fprintf(stdout, "\n\
81 OPTIONS: \n\
82  -i <input image path> \n\
83  Set image input path.\n\
84  From this path read images \n\
85  \"mbt/cube/image%%04d.ppm\". These \n\
86  images come from ViSP-images-x.y.z.tar.gz available \n\
87  on the ViSP website.\n\
88  Setting the VISP_INPUT_IMAGE_PATH environment\n\
89  variable produces the same behavior than using\n\
90  this option.\n\
91 \n\
92  -x <config file> \n\
93  Set the config file (the xml file) to use.\n\
94  The config file is used to specify the parameters of the tracker.\n\
95 \n\
96  -m <model name> \n\
97  Specify the name of the file of the model\n\
98  The model can either be a vrml model (.wrl) or a .cao file.\n\
99 \n\
100  -e <last frame index> \n\
101  Specify the index of the last frame. Once reached, the tracking is stopped\n\
102 \n\
103  -f \n\
104  Do not use the vrml model, use the .cao one. These two models are \n\
105  equivalent and comes from ViSP-images-x.y.z.tar.gz available on the ViSP\n\
106  website. However, the .cao model allows to use the 3d model based tracker \n\
107  without Coin.\n\
108 \n\
109  -n <initialisation file base name> \n\
110  Base name of the initialisation file. The file will be 'base_name'.init .\n\
111  This base name is also used for the optional picture specifying where to \n\
112  click (a .ppm picture).\n\
113 \n\
114  -t \n\
115  Turn off the display of the the klt points. \n\
116 \n\
117  -d \n\
118  Turn off the display.\n\
119 \n\
120  -c\n\
121  Disable the mouse click. Useful to automate the \n\
122  execution of this program without human intervention.\n\
123 \n\
124  -o\n\
125  Use Ogre3D for visibility tests\n\
126 \n\
127  -w\n\
128  When Ogre3D is enable [-o] show Ogre3D configuration dialog that allows to set the renderer.\n\
129 \n\
130  -l\n\
131  Use the scanline for visibility tests.\n\
132 \n\
133  -v\n\
134  Compute covariance matrix.\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 bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile,
144  std::string &initFile, long &lastFrame, bool &displayKltPoints, bool &click_allowed, bool &display,
145  bool &cao3DModel, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline, bool &computeCovariance)
146 {
147  const char *optarg_;
148  int c;
149  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
150 
151  switch (c) {
152  case 'e':
153  lastFrame = atol(optarg_);
154  break;
155  case 'i':
156  ipath = optarg_;
157  break;
158  case 'x':
159  configFile = optarg_;
160  break;
161  case 'm':
162  modelFile = optarg_;
163  break;
164  case 'n':
165  initFile = optarg_;
166  break;
167  case 't':
168  displayKltPoints = false;
169  break;
170  case 'f':
171  cao3DModel = true;
172  break;
173  case 'c':
174  click_allowed = false;
175  break;
176  case 'd':
177  display = false;
178  break;
179  case 'o':
180  useOgre = true;
181  break;
182  case 'l':
183  useScanline = true;
184  break;
185  case 'w':
186  showOgreConfigDialog = true;
187  break;
188  case 'v':
189  computeCovariance = true;
190  break;
191  case 'h':
192  usage(argv[0], NULL);
193  return false;
194  break;
195 
196  default:
197  usage(argv[0], optarg_);
198  return false;
199  break;
200  }
201  }
202 
203  if ((c == 1) || (c == -1)) {
204  // standalone param or error
205  usage(argv[0], NULL);
206  std::cerr << "ERROR: " << std::endl;
207  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
208  return false;
209  }
210 
211  return true;
212 }
213 
214 int main(int argc, const char **argv)
215 {
216  try {
217  std::string env_ipath;
218  std::string opt_ipath;
219  std::string ipath;
220  std::string opt_configFile;
221  std::string configFile;
222  std::string opt_modelFile;
223  std::string modelFile;
224  std::string opt_initFile;
225  std::string initFile;
226  long opt_lastFrame = -1;
227  bool displayKltPoints = true;
228  bool opt_click_allowed = true;
229  bool opt_display = true;
230  bool cao3DModel = false;
231  bool useOgre = false;
232  bool showOgreConfigDialog = false;
233  bool useScanline = false;
234  bool computeCovariance = false;
235  bool quit = false;
236 
237  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH
238  // environment variable value
239  env_ipath = vpIoTools::getViSPImagesDataPath();
240 
241  // Set the default input path
242  if (!env_ipath.empty())
243  ipath = env_ipath;
244 
245  // Read the command line options
246  if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, opt_lastFrame, displayKltPoints,
247  opt_click_allowed, opt_display, cao3DModel, useOgre, showOgreConfigDialog, useScanline,
248  computeCovariance)) {
249  return (-1);
250  }
251 
252  // Test if an input path is set
253  if (opt_ipath.empty() && env_ipath.empty()) {
254  usage(argv[0], NULL);
255  std::cerr << std::endl << "ERROR:" << std::endl;
256  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " << std::endl
257  << " environment variable to specify the location of the " << std::endl
258  << " image path where test images are located." << std::endl
259  << std::endl;
260 
261  return (-1);
262  }
263 
264  // Get the option values
265  if (!opt_ipath.empty())
266  ipath = vpIoTools::createFilePath(opt_ipath, "mbt/cube/image%04d.pgm");
267  else
268  ipath = vpIoTools::createFilePath(env_ipath, "mbt/cube/image%04d.pgm");
269 
270  if (!opt_configFile.empty())
271  configFile = opt_configFile;
272  else if (!opt_ipath.empty())
273  configFile = vpIoTools::createFilePath(opt_ipath, "mbt/cube.xml");
274  else
275  configFile = vpIoTools::createFilePath(env_ipath, "mbt/cube.xml");
276 
277  if (!opt_modelFile.empty()) {
278  modelFile = opt_modelFile;
279  } else {
280  std::string modelFileCao = "mbt/cube.cao";
281  std::string modelFileWrl = "mbt/cube.wrl";
282 
283  if (!opt_ipath.empty()) {
284  if (cao3DModel) {
285  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
286  } else {
287 #ifdef VISP_HAVE_COIN3D
288  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl);
289 #else
290  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
291  modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao);
292 #endif
293  }
294  } else {
295  if (cao3DModel) {
296  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
297  } else {
298 #ifdef VISP_HAVE_COIN3D
299  modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl);
300 #else
301  std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl;
302  modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao);
303 #endif
304  }
305  }
306  }
307 
308  if (!opt_initFile.empty())
309  initFile = opt_initFile;
310  else if (!opt_ipath.empty())
311  initFile = vpIoTools::createFilePath(opt_ipath, "mbt/cube");
312  else
313  initFile = vpIoTools::createFilePath(env_ipath, "mbt/cube");
314 
315  vpImage<unsigned char> I1, I2;
316  vpVideoReader reader;
317 
318  reader.setFileName(ipath);
319  try {
320  reader.open(I1);
321  I2 = I1;
322  } catch (...) {
323  std::cout << "Cannot open sequence: " << ipath << std::endl;
324  return -1;
325  }
326 
327  if (opt_lastFrame > 1 && opt_lastFrame < reader.getLastFrameIndex())
328  reader.setLastFrameIndex(opt_lastFrame);
329 
330  reader.acquire(I1);
331  I2 = I1;
332 
333 // initialise a display
334 #if defined VISP_HAVE_X11
335  vpDisplayX display1, display2;
336 #elif defined VISP_HAVE_GDI
337  vpDisplayGDI display1, display2;
338 #elif defined VISP_HAVE_OPENCV
339  vpDisplayOpenCV display1, display2;
340 #elif defined VISP_HAVE_D3D9
341  vpDisplayD3D display1, display2;
342 #elif defined VISP_HAVE_GTK
343  vpDisplayGTK display1, display2;
344 #else
345  opt_display = false;
346 #endif
347  if (opt_display) {
348 #if defined(VISP_HAVE_DISPLAY)
351  display1.init(I1, 100, 100, "Test tracking (Left)");
352  display2.init(I2, (int)I1.getWidth() / vpDisplay::getDownScalingFactor(I1) + 110, 100, "Test tracking (Right)");
353 #endif
354  vpDisplay::display(I1);
355  vpDisplay::display(I2);
356  vpDisplay::flush(I1);
357  vpDisplay::flush(I2);
358  }
359 
360  vpMbKltMultiTracker tracker(2);
361  vpHomogeneousMatrix c1Mo, c2Mo;
362 
363  // Load tracker config file (camera parameters and moving edge settings)
364  vpCameraParameters cam1, cam2;
365 #if defined(VISP_HAVE_XML2)
366  // From the xml file
367  tracker.loadConfigFile(configFile, configFile);
368 #else
369  // By setting the parameters:
370  cam1.initPersProjWithoutDistortion(547, 542, 338, 234);
371  cam2.initPersProjWithoutDistortion(547, 542, 338, 234);
372 
373  vpKltOpencv klt;
374  klt.setMaxFeatures(10000);
375  klt.setWindowSize(5);
376  klt.setQuality(0.01);
377  klt.setMinDistance(5);
378  klt.setHarrisFreeParameter(0.01);
379  klt.setBlockSize(3);
380  klt.setPyramidLevels(3);
381 
382  tracker.setCameraParameters(cam1, cam2);
383  tracker.setKltOpencv(klt);
384  tracker.setKltMaskBorder(5);
385  tracker.setAngleAppear(vpMath::rad(65));
386  tracker.setAngleDisappear(vpMath::rad(75));
387 
388  // Specify the clipping to use
389  tracker.setNearClippingDistance(0.01);
390  tracker.setFarClippingDistance(0.90);
391  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
392 // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING |
393 // vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING |
394 // vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
395 #endif
396 
397  // Display the klt points
398  tracker.setDisplayFeatures(displayKltPoints);
399 
400  // Tells if the tracker has to use Ogre3D for visibility tests
401  tracker.setOgreVisibilityTest(useOgre);
402  if (useOgre)
403  tracker.setOgreShowConfigDialog(showOgreConfigDialog);
404 
405  // Tells if the tracker has to use the scanline visibility tests
406  tracker.setScanLineVisibilityTest(useScanline);
407 
408  // Tells if the tracker has to compute the covariance matrix
409  tracker.setCovarianceComputation(computeCovariance);
410 
411  // Retrieve the camera parameters from the tracker
412  tracker.getCameraParameters(cam1, cam2);
413 
414  // Loop to position the cube
415  if (opt_display && opt_click_allowed) {
416  while (!vpDisplay::getClick(I1, false)) {
417  vpDisplay::display(I1);
418  vpDisplay::displayText(I1, 15, 10, "click after positioning the object", vpColor::red);
419  vpDisplay::flush(I1);
420  vpTime::wait(100);
421  }
422  }
423 
424  // Load the 3D model (either a vrml file or a .cao file)
425  tracker.loadModel(modelFile);
426 
427  // Initialise the tracker by clicking on the image
428  // This function looks for
429  // - a ./cube/cube.init file that defines the 3d coordinates (in meter,
430  // in the object basis) of the points used for the initialisation
431  // - a ./cube/cube.ppm file to display where the user have to click
432  // (optionnal, set by the third parameter)
433  if (opt_display && opt_click_allowed) {
434  tracker.initClick(I1, I2, initFile, initFile, true);
435  tracker.getPose(c1Mo, c2Mo);
436  // display the 3D model at the given pose
437  tracker.display(I1, I2, c1Mo, c2Mo, cam1, cam2, vpColor::red);
438  } else {
439  vpHomogeneousMatrix c1Moi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
440  vpHomogeneousMatrix c2Moi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872);
441  tracker.initFromPose(I1, I2, c1Moi, c2Moi);
442  }
443 
444  // track the model
445  tracker.track(I1, I2);
446  tracker.getPose(c1Mo, c2Mo);
447 
448  if (opt_display) {
449  vpDisplay::flush(I1);
450  vpDisplay::flush(I2);
451  }
452 
453  while (!reader.end()) {
454  // acquire a new image
455  reader.acquire(I1);
456  I2 = I1;
457  // display the image
458  if (opt_display) {
459  vpDisplay::display(I1);
460  vpDisplay::display(I2);
461  }
462 
463  // Test to reset the tracker
464  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 10) {
465  std::cout << "----------Test reset tracker----------" << std::endl;
466  if (opt_display) {
467  vpDisplay::display(I1);
468  vpDisplay::display(I2);
469  }
470  tracker.resetTracker();
471 #if defined(VISP_HAVE_XML2)
472  tracker.loadConfigFile(configFile, configFile);
473 #else
474  // By setting the parameters:
475  cam1.initPersProjWithoutDistortion(547, 542, 338, 234);
476  cam2.initPersProjWithoutDistortion(547, 542, 338, 234);
477 
478  vpKltOpencv klt;
479  klt.setMaxFeatures(10000);
480  klt.setWindowSize(5);
481  klt.setQuality(0.01);
482  klt.setMinDistance(5);
483  klt.setHarrisFreeParameter(0.01);
484  klt.setBlockSize(3);
485  klt.setPyramidLevels(3);
486 
487  tracker.setCameraParameters(cam1, cam2);
488  tracker.setKltOpencv(klt);
489  tracker.setKltMaskBorder(5);
490  tracker.setAngleAppear(vpMath::rad(65));
491  tracker.setAngleDisappear(vpMath::rad(75));
492 
493  // Specify the clipping to use
494  tracker.setNearClippingDistance(0.01);
495  tracker.setFarClippingDistance(0.90);
496  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
497 // tracker.setClipping(tracker.getClipping() | vpMbtPolygon::LEFT_CLIPPING |
498 // vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING |
499 // vpMbtPolygon::DOWN_CLIPPING); // Equivalent to FOV_CLIPPING
500 #endif
501  tracker.loadModel(modelFile);
502  tracker.setCameraParameters(cam1, cam2);
503  tracker.setOgreVisibilityTest(useOgre);
504  tracker.setScanLineVisibilityTest(useScanline);
505  tracker.setCovarianceComputation(computeCovariance);
506  tracker.initFromPose(I1, I2, c1Mo, c2Mo);
507  }
508 
509  // Test to set an initial pose
510  if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) {
511  c1Mo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
512  c2Mo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946);
513  std::cout << "Test set pose" << std::endl;
514  tracker.setPose(I1, I2, c1Mo, c2Mo);
515  }
516 
517  // track the object: stop tracking from frame 40 to 50
518  if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 ||
519  reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) {
520  tracker.track(I1, I2);
521  tracker.getPose(c1Mo, c2Mo);
522  if (opt_display) {
523  // display the 3D model
524  tracker.display(I1, I2, c1Mo, c2Mo, cam1, cam2, vpColor::darkRed);
525  // display the frame
526  vpDisplay::displayFrame(I1, c1Mo, cam1, 0.05);
527  vpDisplay::displayFrame(I2, c2Mo, cam2, 0.05);
528  }
529  }
530 
531  if (opt_click_allowed) {
532  vpDisplay::displayText(I1, 10, 10, "Click to quit", vpColor::red);
533  if (vpDisplay::getClick(I1, false)) {
534  quit = true;
535  break;
536  }
537  }
538 
539  if (computeCovariance) {
540  std::cout << "Covariance matrix: \n" << tracker.getCovarianceMatrix() << std::endl << std::endl;
541  }
542 
543  if (opt_display) {
544  vpDisplay::flush(I1);
545  vpDisplay::flush(I2);
546  }
547  }
548 
549  std::cout << "Reached last frame: " << reader.getFrameIndex() << std::endl;
550 
551  if (opt_click_allowed && !quit) {
553  }
554 
555  reader.close();
556 
557 #if defined(VISP_HAVE_XML2)
558  // Cleanup memory allocated by xml library used to parse the xml config
559  // file in vpMbKltTracker::loadConfigFile()
561 #endif
562 
563 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION >= 2)
564  // Cleanup memory allocated by Coin library used to load a vrml model in
565  // vpMbKltTracker::loadModel() We clean only if Coin was used.
566  if (!cao3DModel)
567  SoDB::finish();
568 #endif
569 
570  return EXIT_SUCCESS;
571  } catch (const vpException &e) {
572  std::cout << "Catch an exception: " << e << std::endl;
573  return EXIT_FAILURE;
574  }
575 }
576 
577 #else
578 int main()
579 {
580  std::cout << "visp_mbt, visp_gui modules and OpenCV are required to run "
581  "this example."
582  << std::endl;
583  return EXIT_SUCCESS;
584 }
585 #endif
586 #else
587 int main()
588 {
589  std::cout << "Nothing to run, deprecated example." << std::endl;
590  return 0;
591 }
592 #endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
VISP_EXPORT int wait(double t0, double t)
Definition: vpTime.cpp:150
long getFrameIndex() const
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1316
void setHarrisFreeParameter(double harris_k)
unsigned int getWidth() const
Definition: vpImage.h:239
Implementation of an homogeneous matrix and operations on such kind of matrices.
virtual void setDownScalingFactor(unsigned int scale)
Definition: vpDisplay.cpp:232
static const vpColor darkRed
Definition: vpColor.h:181
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:129
void setMaxFeatures(const int maxCount)
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:151
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:71
static void flush(const vpImage< unsigned char > &I)
long getFirstFrameIndex()
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:69
static const vpColor red
Definition: vpColor.h:180
void setQuality(double qualityLevel)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void open(vpImage< vpRGBa > &I)
long getLastFrameIndex()
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed...
Definition: vpDisplayD3D.h:107
static std::string createFilePath(const std::string &parent, const std::string &child)
Definition: vpIoTools.cpp:1541
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
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)
void setPyramidLevels(const int pyrMaxLevel)
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
static double rad(double deg)
Definition: vpMath.h:102
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
static void cleanup()
Definition: vpXmlParser.h:310
void setWindowSize(const int winSize)
void setLastFrameIndex(const long last_frame)
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))
unsigned int getDownScalingFactor()
Definition: vpDisplay.h:229
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
Definition: vpKltOpencv.h:78
void setBlockSize(const int blockSize)
Model based stereo (or more) tracker using only KLT.