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