Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
templateTracker.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 template tracking.
33  *
34  * Authors:
35  * Amaury Dame
36  * Aurelien Yol
37  *
38 *****************************************************************************/
39 
46 #include <iostream>
47 #include <visp3/core/vpConfig.h>
48 
49 #if defined(VISP_HAVE_MODULE_TT) && defined(VISP_HAVE_DISPLAY)
50 
51 #include <visp3/core/vpDebug.h>
52 #include <visp3/core/vpHomogeneousMatrix.h>
53 #include <visp3/core/vpIoTools.h>
54 #include <visp3/core/vpMath.h>
55 #include <visp3/gui/vpDisplayD3D.h>
56 #include <visp3/gui/vpDisplayGDI.h>
57 #include <visp3/gui/vpDisplayGTK.h>
58 #include <visp3/gui/vpDisplayOpenCV.h>
59 #include <visp3/gui/vpDisplayX.h>
60 #include <visp3/io/vpImageIo.h>
61 #include <visp3/io/vpParseArgv.h>
62 #include <visp3/io/vpVideoReader.h>
63 
64 #include <visp3/tt/vpTemplateTrackerSSD.h>
65 #include <visp3/tt/vpTemplateTrackerSSDESM.h>
66 #include <visp3/tt/vpTemplateTrackerSSDForwardAdditional.h>
67 #include <visp3/tt/vpTemplateTrackerSSDForwardCompositional.h>
68 #include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h>
69 #include <visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h>
70 #include <visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h>
71 
72 #include <visp3/tt/vpTemplateTrackerWarpAffine.h>
73 #include <visp3/tt/vpTemplateTrackerWarpHomography.h>
74 #include <visp3/tt/vpTemplateTrackerWarpHomographySL3.h>
75 #include <visp3/tt/vpTemplateTrackerWarpRT.h>
76 #include <visp3/tt/vpTemplateTrackerWarpSRT.h>
77 #include <visp3/tt/vpTemplateTrackerWarpTranslation.h>
78 
79 #ifdef VISP_HAVE_MODULE_TT_MI
80 #include <visp3/tt_mi/vpTemplateTrackerMIESM.h>
81 #include <visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h>
82 #include <visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h>
83 #include <visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h>
84 #endif
85 
86 #define GETOPTARGS "cdhi:l:Lprs:t:w:"
87 
88 #ifdef ENABLE_VISP_NAMESPACE
89 using namespace VISP_NAMESPACE_NAME;
90 #endif
91 
92 #ifndef DOXYGEN_SHOULD_SKIP_THIS
93 typedef enum
94 {
95  WARP_AFFINE,
96  WARP_HOMOGRAPHY,
97  WARP_HOMOGRAPHY_SL3,
98  WARP_SRT,
99  WARP_TRANSLATION,
100 #ifdef VISP_HAVE_MODULE_TT_MI
101  WARP_RT,
102 #endif
103  WARP_LAST
104 } WarpType;
105 
106 typedef enum
107 {
108  TRACKER_SSD_ESM,
109  TRACKER_SSD_FORWARD_ADDITIONAL,
110  TRACKER_SSD_FORWARD_COMPOSITIONAL,
111  TRACKER_SSD_INVERSE_COMPOSITIONAL, // The most efficient
112  TRACKER_ZNCC_FORWARD_ADDITIONEL,
113  TRACKER_ZNCC_INVERSE_COMPOSITIONAL,
114 #ifdef VISP_HAVE_MODULE_TT_MI
115  TRACKER_MI_ESM,
116  TRACKER_MI_FORWARD_ADDITIONAL,
117  TRACKER_MI_FORWARD_COMPOSITIONAL,
118  TRACKER_MI_INVERSE_COMPOSITIONAL, // The most efficient
119 #endif
120  TRACKER_LAST
121 } TrackerType;
122 
123 #endif
124 
125 void usage(const char *name, const char *badparam, const WarpType &warp_type, TrackerType &tracker_type,
126  const long &last_frame, const double &residual_threhold)
127 {
128 #if VISP_HAVE_DATASET_VERSION >= 0x030600
129  std::string ext("png");
130 #else
131  std::string ext("pgm");
132 #endif
133 
134  fprintf(stdout, "\n\
135 Example of template tracking.\n\
136 \n\
137 SYNOPSIS\n\
138  %s [-i <test image path>] [-c] [-d] [-p] \n\
139  [-w <warp type>] [-t <tracker type>] \n\
140  [-l <last frame number>] [-r] [-L] [-h]\n",
141  name);
142 
143  fprintf(stdout, "\n\
144 OPTIONS: Default\n\
145  -i <input image path> \n\
146  Set image input path.\n\
147  From this path read images \n\
148  \"mire-2/image%%04d.%s\". These \n\
149  images come from ViSP-images-x.y.z.tar.gz available \n\
150  on the ViSP website.\n\
151  Setting the VISP_INPUT_IMAGE_PATH environment\n\
152  variable produces the same behaviour than using\n\
153  this option.\n\
154  \n\
155  -l <last frame number> %ld\n\
156  Last frame number to consider.\n\
157  \n\
158  -d \n\
159  Turn off the display.\n\
160  \n\
161  -c\n\
162  Disable the mouse click. Useful to automate the \n\
163  execution of this program without human intervention.\n\
164  \n",
165  ext.c_str(), last_frame);
166 
167 #ifdef VISP_HAVE_MODULE_TT_MI
168  fprintf(stdout, "\n\
169  -w <warp type=[0,1,2,3,4,5]> %d\n\
170  Set the model used to warp the template. \n\
171  Authorized values are:\n\
172  %d : Affine\n\
173  %d : Homography\n\
174  %d : Homography in SL3\n\
175  %d : SRT (scale, rotation, translation)\n\
176  %d : Translation\n\
177  %d : RT (rotation, translation)\n\n",
178  (int)warp_type, (int)WARP_AFFINE, (int)WARP_HOMOGRAPHY, (int)WARP_HOMOGRAPHY_SL3, (int)WARP_SRT,
179  (int)WARP_TRANSLATION, (int)WARP_RT);
180 #else
181  fprintf(stdout, "\n\
182  -w <warp type=[0,1,2,3,4]> %d\n\
183  Set the model used to warp the template. \n\
184  Authorized values are:\n\
185  %d : Affine\n\
186  %d : Homography\n\
187  %d : Homography in SL3\n\
188  %d : SRT (scale, rotation, translation)\n\
189  %d : Translation\n\n",
190  (int)warp_type, (int)WARP_AFFINE, (int)WARP_HOMOGRAPHY, (int)WARP_HOMOGRAPHY_SL3, (int)WARP_SRT,
191  (int)WARP_TRANSLATION);
192 #endif
193 
194 #ifdef VISP_HAVE_MODULE_TT_MI
195  fprintf(stdout, "\n\
196  -t <tracker type=[0,1,2,3,4,5,6,7,8,9]> %d\n\
197  Set the tracker used to track the template. \n\
198  Authorized values are:\n\
199  %d : SSD ESM\n\
200  %d : SSD forward additional\n\
201  %d : SSD forward compositional\n\
202  %d : SSD inverse compositional\n\
203  %d : ZNCC forward additional\n\
204  %d : ZNCC inverse compositional\n\
205  %d : MI ESM\n\
206  %d : MI forward additional\n\
207  %d : MI forward compositional\n\
208  %d : MI inverse compositional\n",
209  (int)tracker_type, (int)TRACKER_SSD_ESM, (int)TRACKER_SSD_FORWARD_ADDITIONAL,
210  (int)TRACKER_SSD_FORWARD_COMPOSITIONAL, (int)TRACKER_SSD_INVERSE_COMPOSITIONAL,
211  (int)TRACKER_ZNCC_FORWARD_ADDITIONEL, (int)TRACKER_ZNCC_INVERSE_COMPOSITIONAL, (int)TRACKER_MI_ESM,
212  (int)TRACKER_MI_FORWARD_ADDITIONAL, (int)TRACKER_MI_FORWARD_COMPOSITIONAL,
213  (int)TRACKER_MI_INVERSE_COMPOSITIONAL);
214 #else
215  fprintf(stdout, "\n\
216  -t <tracker type=[0,1,2,3,4,5]> %d\n\
217  Set the tracker used to track the template. \n\
218  Authorized values are:\n\
219  %d : SSD ESM\n\
220  %d : SSD forward additional\n\
221  %d : SSD forward compositional\n\
222  %d : SSD inverse compositional\n\
223  %d : ZNCC forward additional\n\
224  %d : ZNCC inverse compositional\n",
225  (int)tracker_type, (int)TRACKER_SSD_ESM, (int)TRACKER_SSD_FORWARD_ADDITIONAL,
226  (int)TRACKER_SSD_FORWARD_COMPOSITIONAL, (int)TRACKER_SSD_INVERSE_COMPOSITIONAL,
227  (int)TRACKER_ZNCC_FORWARD_ADDITIONEL, (int)TRACKER_ZNCC_INVERSE_COMPOSITIONAL);
228 
229 #endif
230  fprintf(stdout, "\n\
231  -p\n\
232  Enable pyramidal tracking.\n\
233  \n\
234  -r\n\
235  Disable re-init at frame 10.\n\
236  \n\
237  -s <residual threshold> %g\n\
238  Threshold used to stop optimization when residual difference\n\
239  between two successive optimization iteration becomes lower\n\
240  that this parameter.\n\
241  \n\
242  -L \n\
243  Create log file.\n\
244  \n\
245  -h \n\
246  Print the help.\n\n",
247  residual_threhold);
248 
249  if (badparam)
250  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
251 }
252 
253 bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display, bool &pyramidal,
254  WarpType &warp_type, TrackerType &tracker_type, long &last_frame, bool &reinit,
255  double &threshold_residual, bool &log)
256 {
257  const char *optarg_;
258  int c;
259  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
260 
261  switch (c) {
262  case 'c':
263  click_allowed = false;
264  break;
265  case 'd':
266  display = false;
267  break;
268  case 'h':
269  usage(argv[0], nullptr, warp_type, tracker_type, last_frame, threshold_residual);
270  return false;
271  break;
272  case 'i':
273  ipath = optarg_;
274  break;
275  case 'l':
276  last_frame = (long)atoi(optarg_);
277  break;
278  case 'L':
279  log = true;
280  break;
281  case 'p':
282  pyramidal = true;
283  break;
284  case 'r':
285  reinit = false;
286  break;
287  case 't':
288  tracker_type = (TrackerType)atoi(optarg_);
289  break;
290  case 'w':
291  warp_type = (WarpType)atoi(optarg_);
292  break;
293  case 's':
294  threshold_residual = std::atof(optarg_);
295  break;
296 
297  default:
298  usage(argv[0], optarg_, warp_type, tracker_type, last_frame, threshold_residual);
299  return false;
300  break;
301  }
302  }
303 
304  if (warp_type >= WARP_LAST) {
305  usage(argv[0], nullptr, warp_type, tracker_type, last_frame, threshold_residual);
306  std::cerr << "ERROR: " << std::endl;
307  std::cerr << " Bad argument -w <warp type> with \"warp type\"=" << (int)warp_type << std::endl << std::endl;
308  return false;
309  }
310  if (tracker_type >= TRACKER_LAST) {
311  usage(argv[0], nullptr, warp_type, tracker_type, last_frame, threshold_residual);
312  std::cerr << "ERROR: " << std::endl;
313  std::cerr << " Bad argument -t <tracker type> with \"tracker type\"=" << (int)tracker_type << std::endl
314  << std::endl;
315  return false;
316  }
317  if ((c == 1) || (c == -1)) {
318  // standalone param or error
319  usage(argv[0], nullptr, warp_type, tracker_type, last_frame, threshold_residual);
320  std::cerr << "ERROR: " << std::endl;
321  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
322  return false;
323  }
324 
325  return true;
326 }
327 
328 int main(int argc, const char **argv)
329 {
330 #if defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV)
331  try {
332  std::string env_ipath;
333  std::string opt_ipath;
334  std::string ipath;
335  bool opt_click_allowed = true;
336  bool opt_display = true;
337  bool opt_pyramidal = false;
338  TrackerType opt_tracker_type = TRACKER_SSD_INVERSE_COMPOSITIONAL;
339  WarpType opt_warp_type = WARP_AFFINE;
340  long opt_last_frame = 30;
341  bool opt_reinit = true;
342  double opt_threshold_residual = 1e-4;
343  bool opt_log = false;
344  std::ofstream ofs;
345 
346  // Set the default output path
347 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
348  std::string opath = "/tmp";
349 #elif defined(_WIN32)
350  std::string opath = "C:\\temp";
351 #endif
352 
353 #if VISP_HAVE_DATASET_VERSION >= 0x030600
354  std::string ext("png");
355 #else
356  std::string ext("pgm");
357 #endif
358 
359  // Get the user login name
360  std::string username;
361  vpIoTools::getUserName(username);
362 
363  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH
364  // environment variable value
365  env_ipath = vpIoTools::getViSPImagesDataPath();
366 
367  // Set the default input path
368  if (!env_ipath.empty())
369  ipath = env_ipath;
370 
371  // Append to the output path string, the login name of the user
372  std::string odirname = vpIoTools::createFilePath(opath, username);
373  std::string logfilename = vpIoTools::createFilePath(odirname, "template-tracker.log");
374 
375  // Read the command line options
376  if (!getOptions(argc, argv, opt_ipath, opt_click_allowed, opt_display, opt_pyramidal, opt_warp_type,
377  opt_tracker_type, opt_last_frame, opt_reinit, opt_threshold_residual, opt_log)) {
378  return EXIT_FAILURE;
379  }
380 
381  // Test if an input path is set
382  if (opt_ipath.empty() && env_ipath.empty()) {
383  usage(argv[0], nullptr, opt_warp_type, opt_tracker_type, opt_last_frame, opt_threshold_residual);
384  std::cerr << std::endl << "ERROR:" << std::endl;
385  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " << std::endl
386  << " environment variable to specify the location of the " << std::endl
387  << " image path where test images are located." << std::endl
388  << std::endl;
389 
390  return EXIT_FAILURE;
391  }
392 
393  // Get the option values
394  if (!opt_ipath.empty())
395  ipath = vpIoTools::createFilePath(opt_ipath, "mire-2/image.%04d." + ext);
396  else
397  ipath = vpIoTools::createFilePath(env_ipath, "mire-2/image.%04d." + ext);
398 
399  if (opt_log) {
400  ofs.open(logfilename.c_str());
401  }
402 
404  vpVideoReader reader;
405 
406  reader.setFileName(ipath.c_str());
407  reader.setFirstFrameIndex(1);
408  reader.setLastFrameIndex(opt_last_frame);
409  try {
410  reader.open(I);
411  }
412  catch (...) {
413  std::cout << "Cannot open sequence: " << ipath << std::endl;
414  return EXIT_FAILURE;
415  }
416  reader.acquire(I);
417 
418  vpDisplay *display = nullptr;
419  if (opt_display) {
420 // initialise a display
421 #if defined(VISP_HAVE_X11)
422  display = new vpDisplayX;
423 #elif defined(VISP_HAVE_GDI)
424  display = new vpDisplayGDI;
425 #elif defined(HAVE_OPENCV_HIGHGUI)
426  display = new vpDisplayOpenCV;
427 #elif defined(VISP_HAVE_D3D9)
428  display = new vpDisplayD3D;
429 #elif defined(VISP_HAVE_GTK)
430  display = new vpDisplayGTK;
431 #else
432  opt_display = false;
433 #endif
434 #if defined(VISP_HAVE_DISPLAY)
435  display->init(I, 100, 100, "Test tracking");
436 #endif
438  vpDisplay::flush(I);
439  }
440 
441  vpTemplateTrackerWarp *warp = nullptr;
442  switch (opt_warp_type) {
443  case WARP_AFFINE:
444  warp = new vpTemplateTrackerWarpAffine;
445  break;
446  case WARP_HOMOGRAPHY:
448  break;
449  case WARP_HOMOGRAPHY_SL3:
451  break;
452  case WARP_SRT:
453  warp = new vpTemplateTrackerWarpSRT;
454  break;
455  case WARP_TRANSLATION:
457  break;
458 #ifdef VISP_HAVE_MODULE_TT_MI
459  case WARP_RT:
460  warp = new vpTemplateTrackerWarpRT;
461  break;
462 #endif
463  default:
464  return EXIT_FAILURE;
465  }
466 
467  vpTemplateTracker *tracker = nullptr;
468  switch (opt_tracker_type) {
469  case TRACKER_SSD_ESM:
470  tracker = new vpTemplateTrackerSSDESM(warp);
471  break;
472  case TRACKER_SSD_FORWARD_ADDITIONAL:
473  tracker = new vpTemplateTrackerSSDForwardAdditional(warp);
474  break;
475  case TRACKER_SSD_FORWARD_COMPOSITIONAL:
476  tracker = new vpTemplateTrackerSSDForwardCompositional(warp);
477  break;
478  case TRACKER_SSD_INVERSE_COMPOSITIONAL:
479  tracker = new vpTemplateTrackerSSDInverseCompositional(warp);
480  break;
481  case TRACKER_ZNCC_FORWARD_ADDITIONEL:
482  tracker = new vpTemplateTrackerZNCCForwardAdditional(warp);
483  break;
484  case TRACKER_ZNCC_INVERSE_COMPOSITIONAL:
485  tracker = new vpTemplateTrackerZNCCInverseCompositional(warp);
486  break;
487 #ifdef VISP_HAVE_MODULE_TT_MI
488  case TRACKER_MI_ESM:
489  tracker = new vpTemplateTrackerMIESM(warp);
490  break;
491  case TRACKER_MI_FORWARD_ADDITIONAL:
492  tracker = new vpTemplateTrackerMIForwardAdditional(warp);
493  break;
494  case TRACKER_MI_FORWARD_COMPOSITIONAL:
495  tracker = new vpTemplateTrackerMIForwardCompositional(warp);
496  break;
497  case TRACKER_MI_INVERSE_COMPOSITIONAL:
498  tracker = new vpTemplateTrackerMIInverseCompositional(warp);
499  break;
500 #endif
501  default:
502  return EXIT_FAILURE;
503  }
504 
505  tracker->setSampling(2, 2);
506  tracker->setLambda(0.001);
507  tracker->setThresholdGradient(60.);
508  tracker->setIterationMax(800);
509  if (opt_pyramidal) {
510  tracker->setPyramidal(2, 1);
511  }
512  tracker->setThresholdResidualDifference(opt_threshold_residual);
513  bool delaunay = false;
514  if (opt_display && opt_click_allowed)
515  tracker->initClick(I, delaunay);
516  else {
517  std::vector<vpImagePoint> v_ip;
518  vpImagePoint ip;
519  ip.set_ij(166, 54);
520  v_ip.push_back(ip);
521  ip.set_ij(284, 55);
522  v_ip.push_back(ip);
523  ip.set_ij(259, 284);
524  v_ip.push_back(ip); // ends the first triangle
525  ip.set_ij(259, 284);
526  v_ip.push_back(ip); // start the second triangle
527  ip.set_ij(149, 240);
528  v_ip.push_back(ip);
529  ip.set_ij(167, 58);
530  v_ip.push_back(ip);
531 
532  tracker->initFromPoints(I, v_ip, false);
533  }
534 
535  double t_init = vpTime::measureTimeMs();
536  int niter = 0;
537 
538  while (!reader.end()) {
539  // Acquire a new image
540  reader.acquire(I);
541  std::cout << "Process image number " << reader.getFrameIndex() << std::endl;
542  // Display the image
544  // Track the template
545  tracker->track(I);
546  // Save log
547  if (opt_log) {
548  ofs << tracker->getNbIteration() << std::endl;
549  }
550 
551  // Simulate a re-init
552  if (opt_reinit && (reader.getFrameIndex() == 10)) {
553  std::cout << "re-init simulation" << std::endl;
554  if (opt_click_allowed)
556 
557  tracker->resetTracker();
558 
559  if (opt_display && opt_click_allowed) {
560  vpDisplay::displayText(I, 10, 10, "Re-init simulation", vpColor::red);
561  vpDisplay::flush(I);
562  tracker->initClick(I, delaunay);
563  }
564  else {
565  std::vector<vpImagePoint> v_ip;
566  vpImagePoint ip;
567  ip.set_ij(146, 60);
568  v_ip.push_back(ip);
569  ip.set_ij(254, 74);
570  v_ip.push_back(ip);
571  ip.set_ij(228, 288);
572  v_ip.push_back(ip); // ends the first triangle
573  ip.set_ij(228, 288);
574  v_ip.push_back(ip); // start the second triangle
575  ip.set_ij(126, 242);
576  v_ip.push_back(ip);
577  ip.set_ij(146, 60);
578  v_ip.push_back(ip);
579 
580  tracker->initFromPoints(I, v_ip, false);
581  }
582  }
583 
584 // Display the template
585 #if 1
586  tracker->display(I, vpColor::red, 3);
587 #else
588  vpTemplateTrackerZone zoneWarped_, zoneRef_ = tracker->getZoneRef();
589  vpTemplateTrackerWarp *warp_ = tracker->getWarp();
590  vpColVector p_ = tracker->getp();
591  warp_->warpZone(zoneRef_, p_, zoneWarped_);
592  zoneWarped_.display(I, vpColor::red, 3);
593  zoneRef_.display(I, vpColor::green, 3);
594 #endif
595 
596  vpDisplay::flush(I);
597 
598  niter++;
599  }
600  double t_end = vpTime::measureTimeMs();
601  std::cout << "Total time: " << t_end - t_init << " ms" << std::endl;
602  std::cout << "Total mean: " << (t_end - t_init) / niter << " ms" << std::endl;
603 
604  if (opt_log) {
605  std::cout << "Log are saved in: " << logfilename << std::endl;
606  ofs.close();
607  }
608 
609  if (opt_click_allowed) {
610  vpDisplay::displayText(I, 10, 10, "A click to exit...", vpColor::red);
611  vpDisplay::flush(I);
613  }
614  reader.close();
615  if (display)
616  delete display;
617 
618  delete warp;
619  delete tracker;
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 #else
628  (void)argc;
629  (void)argv;
630  std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
631 #endif
632 }
633 
634 #else
635 
636 int main()
637 {
638  std::cout << "visp_tt module or display not available." << std::endl;
639  return EXIT_SUCCESS;
640 }
641 
642 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
static const vpColor red
Definition: vpColor.h:217
static const vpColor green
Definition: vpColor.h:220
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...
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition: vpDisplayX.h:135
Class that defines generic functionalities for display.
Definition: vpDisplay.h:178
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
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
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:82
void set_ij(double ii, double jj)
Definition: vpImagePoint.h:320
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1053
static std::string getUserName()
Definition: vpIoTools.cpp:285
static std::string createFilePath(const std::string &parent, const std::string &child)
Definition: vpIoTools.cpp:1427
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:70
void warpZone(const vpTemplateTrackerZone &in, const vpColVector &p, vpTemplateTrackerZone &out)
void display(const vpImage< unsigned char > &I, const vpColor &col=vpColor::green, unsigned int thickness=3)
void display(const vpImage< unsigned char > &I, const vpColor &col=vpColor::green, unsigned int thickness=3)
void setThresholdGradient(double threshold)
unsigned int getNbIteration() const
void setThresholdResidualDifference(double threshold)
void initFromPoints(const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &v_ip, bool delaunay=false)
void setIterationMax(const unsigned int &n)
void setPyramidal(unsigned int nlevels=2, unsigned int level_to_stop=1)
vpColVector getp() const
void track(const vpImage< unsigned char > &I)
void setLambda(double l)
vpTemplateTrackerZone getZoneRef() const
void setSampling(int sample_i, int sample_j)
vpTemplateTrackerWarp * getWarp() const
void initClick(const vpImage< unsigned char > &I, bool delaunay=false)
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)
void open(vpImage< vpRGBa > &I)
void setFileName(const std::string &filename)
void setFirstFrameIndex(const long first_frame)
long getFrameIndex() const
VISP_EXPORT double measureTimeMs()