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