Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
testGenericTracker.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  * Regression test for MBT.
33  *
34  *****************************************************************************/
35 
42 #include <cstdlib>
43 #include <iostream>
44 #include <visp3/core/vpConfig.h>
45 
46 #if defined(VISP_HAVE_MODULE_MBT)
47 
48 #include <visp3/core/vpIoTools.h>
49 #include <visp3/io/vpParseArgv.h>
50 #include <visp3/io/vpImageIo.h>
51 #include <visp3/gui/vpDisplayX.h>
52 #include <visp3/gui/vpDisplayGDI.h>
53 #include <visp3/gui/vpDisplayOpenCV.h>
54 #include <visp3/gui/vpDisplayD3D.h>
55 #include <visp3/gui/vpDisplayGTK.h>
56 #include <visp3/mbt/vpMbGenericTracker.h>
57 
58 #define GETOPTARGS "i:dclt:e:Dmh"
59 
60 namespace
61 {
62  void usage(const char *name, const char *badparam)
63  {
64  fprintf(stdout, "\n\
65  Regression test for vpGenericTracker.\n\
66  \n\
67  SYNOPSIS\n\
68  %s [-i <test image path>] [-c] [-d] [-h] [-l] \n\
69  [-t <tracker type>] [-e <last frame index>] [-D] [-m]\n", name);
70 
71  fprintf(stdout, "\n\
72  OPTIONS: \n\
73  -i <input image path> \n\
74  Set image input path.\n\
75  These images come from ViSP-images-x.y.z.tar.gz available \n\
76  on the ViSP website.\n\
77  Setting the VISP_INPUT_IMAGE_PATH environment\n\
78  variable produces the same behavior than using\n\
79  this option.\n\
80  \n\
81  -d \n\
82  Turn off the display.\n\
83  \n\
84  -c\n\
85  Disable the mouse click. Useful to automate the \n\
86  execution of this program without human intervention.\n\
87  \n\
88  -t <tracker type>\n\
89  Set tracker type (<1 (Edge)>, <2 (KLT)>, <3 (both)>) for color sensor.\n\
90  \n\
91  -l\n\
92  Use the scanline for visibility tests.\n\
93  \n\
94  -e <last frame index>\n\
95  Specify the index of the last frame. Once reached, the tracking is stopped.\n\
96  \n\
97  -D \n\
98  Use depth.\n\
99  \n\
100  -m \n\
101  Set a tracking mask.\n\
102  \n\
103  -h \n\
104  Print the help.\n\n");
105 
106  if (badparam)
107  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
108  }
109 
110  bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display,
111  bool &useScanline, int &trackerType, int &lastFrame, bool &use_depth, bool &use_mask)
112  {
113  const char *optarg_;
114  int c;
115  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
116 
117  switch (c) {
118  case 'i':
119  ipath = optarg_;
120  break;
121  case 'c':
122  click_allowed = false;
123  break;
124  case 'd':
125  display = false;
126  break;
127  case 'l':
128  useScanline = true;
129  break;
130  case 't':
131  trackerType = atoi(optarg_);
132  break;
133  case 'e':
134  lastFrame = atoi(optarg_);
135  break;
136  case 'D':
137  use_depth = true;
138  break;
139  case 'm':
140  use_mask = true;
141  break;
142  case 'h':
143  usage(argv[0], NULL);
144  return false;
145  break;
146 
147  default:
148  usage(argv[0], optarg_);
149  return false;
150  break;
151  }
152  }
153 
154  if ((c == 1) || (c == -1)) {
155  // standalone param or error
156  usage(argv[0], NULL);
157  std::cerr << "ERROR: " << std::endl;
158  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
159  return false;
160  }
161 
162  return true;
163  }
164 
165  bool read_data(const std::string &input_directory, const int cpt, const vpCameraParameters &cam_depth,
167  std::vector<vpColVector> &pointcloud, vpHomogeneousMatrix &cMo)
168  {
169  char buffer[256];
170  sprintf(buffer, std::string(input_directory + "/Images/Image_%04d.pgm").c_str(), cpt);
171  std::string image_filename = buffer;
172 
173  sprintf(buffer, std::string(input_directory + "/Depth/Depth_%04d.bin").c_str(), cpt);
174  std::string depth_filename = buffer;
175 
176  sprintf(buffer, std::string(input_directory + "/CameraPose/Camera_%03d.txt").c_str(), cpt);
177  std::string pose_filename = buffer;
178 
179  if (!vpIoTools::checkFilename(image_filename) || !vpIoTools::checkFilename(depth_filename)
180  || !vpIoTools::checkFilename(pose_filename))
181  return false;
182 
183  vpImageIo::read(I, image_filename);
184 
185  unsigned int depth_width = 0, depth_height = 0;
186  std::ifstream file_depth(depth_filename.c_str(), std::ios::in | std::ios::binary);
187  if (!file_depth.is_open())
188  return false;
189 
190  vpIoTools::readBinaryValueLE(file_depth, depth_height);
191  vpIoTools::readBinaryValueLE(file_depth, depth_width);
192  I_depth.resize(depth_height, depth_width);
193  pointcloud.resize(depth_height*depth_width);
194 
195  const float depth_scale = 0.000030518f;
196  for (unsigned int i = 0; i < I_depth.getHeight(); i++) {
197  for (unsigned int j = 0; j < I_depth.getWidth(); j++) {
198  vpIoTools::readBinaryValueLE(file_depth, I_depth[i][j]);
199  double x = 0.0, y = 0.0, Z = I_depth[i][j] * depth_scale;
200  vpPixelMeterConversion::convertPoint(cam_depth, j, i, x, y);
201  vpColVector pt3d(4, 1.0);
202  pt3d[0] = x*Z;
203  pt3d[1] = y*Z;
204  pt3d[2] = Z;
205  pointcloud[i*I_depth.getWidth()+j] = pt3d;
206  }
207  }
208 
209  std::ifstream file_pose(pose_filename.c_str());
210  if (!file_pose.is_open()) {
211  return false;
212  }
213 
214  for (unsigned int i = 0; i < 4; i++) {
215  for (unsigned int j = 0; j < 4; j++) {
216  file_pose >> cMo[i][j];
217  }
218  }
219 
220  return true;
221  }
222 }
223 
224 int main(int argc, const char *argv[])
225 {
226  try {
227  std::string env_ipath;
228  std::string opt_ipath = "";
229  bool opt_click_allowed = true;
230  bool opt_display = true;
231  bool useScanline = false;
232  int trackerType_image = vpMbGenericTracker::EDGE_TRACKER;
233 #if defined(__mips__) || defined(__mips) || defined(mips) || defined(__MIPS__)
234  // To avoid Debian test timeout
235  int opt_lastFrame = 5;
236 #else
237  int opt_lastFrame = -1;
238 #endif
239  bool use_depth = false;
240  bool use_mask = false;
241 
242  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH
243  // environment variable value
244  env_ipath = vpIoTools::getViSPImagesDataPath();
245 
246  // Read the command line options
247  if (!getOptions(argc, argv, opt_ipath, opt_click_allowed, opt_display,
248  useScanline, trackerType_image, opt_lastFrame, use_depth,
249  use_mask)) {
250  return EXIT_FAILURE;
251  }
252 
253  std::cout << "trackerType_image: " << trackerType_image << std::endl;
254  std::cout << "useScanline: " << useScanline << std::endl;
255  std::cout << "use_depth: " << use_depth << std::endl;
256  std::cout << "use_mask: " << use_mask << std::endl;
257 #ifdef VISP_HAVE_COIN3D
258  std::cout << "COIN3D available." << std::endl;
259 #endif
260 
261 #if !defined(VISP_HAVE_MODULE_KLT) || (!defined(VISP_HAVE_OPENCV) || (VISP_HAVE_OPENCV_VERSION < 0x020100))
262  if (trackerType_image & 2) {
263  std::cout << "KLT features cannot be used: ViSP is not built with "
264  "KLT module or OpenCV is not available.\nTest is not run."
265  << std::endl;
266  return EXIT_SUCCESS;
267  }
268 #endif
269 
270  // Test if an input path is set
271  if (opt_ipath.empty() && env_ipath.empty()) {
272  usage(argv[0], NULL);
273  std::cerr << std::endl << "ERROR:" << std::endl;
274  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " << std::endl
275  << " environment variable to specify the location of the " << std::endl
276  << " image path where test images are located." << std::endl
277  << std::endl;
278 
279  return EXIT_FAILURE;
280  }
281 
282  std::string input_directory = vpIoTools::createFilePath(!opt_ipath.empty() ? opt_ipath : env_ipath, "mbt-depth/Castle-simu");
283  if (!vpIoTools::checkDirectory(input_directory)) {
284  std::cerr << "ViSP-images does not contain the folder: " << input_directory << "!" << std::endl;
285  return EXIT_SUCCESS;
286  }
287 
288  // Initialise a display
289 #if defined VISP_HAVE_X11
290  vpDisplayX display1, display2;
291 #elif defined VISP_HAVE_GDI
292  vpDisplayGDI display1, display2;
293 #elif defined VISP_HAVE_OPENCV
294  vpDisplayOpenCV display1, display2;
295 #elif defined VISP_HAVE_D3D9
296  vpDisplayD3D display1, display2;
297 #elif defined VISP_HAVE_GTK
298  vpDisplayGTK display1, display2;
299 #else
300  opt_display = false;
301 #endif
302 
303  std::vector<int> tracker_type(2);
304  tracker_type[0] = trackerType_image;
305  tracker_type[1] = vpMbGenericTracker::DEPTH_DENSE_TRACKER;
306  vpMbGenericTracker tracker(tracker_type);
307 #if defined(VISP_HAVE_XML2)
308  tracker.loadConfigFile(input_directory + "/Config/chateau.xml", input_directory + "/Config/chateau_depth.xml");
309 #else
310  {
311  vpCameraParameters cam_color, cam_depth;
312  cam_color.initPersProjWithoutDistortion(700.0, 700.0, 320.0, 240.0);
313  cam_depth.initPersProjWithoutDistortion(700.0, 700.0, 320.0, 240.0);
314  tracker.setCameraParameters(cam_color, cam_depth);
315  }
316 
317  // Edge
318  vpMe me;
319  me.setMaskSize(5);
320  me.setMaskNumber(180);
321  me.setRange(8);
322  me.setThreshold(10000);
323  me.setMu1(0.5);
324  me.setMu2(0.5);
325  me.setSampleStep(5);
326  tracker.setMovingEdge(me);
327 
328  // Klt
329 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
330  vpKltOpencv klt;
331  tracker.setKltMaskBorder(5);
332  klt.setMaxFeatures(10000);
333  klt.setWindowSize(5);
334  klt.setQuality(0.01);
335  klt.setMinDistance(5);
336  klt.setHarrisFreeParameter(0.02);
337  klt.setBlockSize(3);
338  klt.setPyramidLevels(3);
339 
340  tracker.setKltOpencv(klt);
341 #endif
342 
343  // Depth
344  tracker.setDepthNormalFeatureEstimationMethod(vpMbtFaceDepthNormal::ROBUST_FEATURE_ESTIMATION);
345  tracker.setDepthNormalPclPlaneEstimationMethod(2);
346  tracker.setDepthNormalPclPlaneEstimationRansacMaxIter(200);
347  tracker.setDepthNormalPclPlaneEstimationRansacThreshold(0.001);
348  tracker.setDepthNormalSamplingStep(2, 2);
349 
350  tracker.setDepthDenseSamplingStep(4, 4);
351 
352  tracker.setAngleAppear(vpMath::rad(85.0));
353  tracker.setAngleDisappear(vpMath::rad(89.0));
354  tracker.setNearClippingDistance(0.01);
355  tracker.setFarClippingDistance(2.0);
356  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
357 #endif
358 
359 #ifdef VISP_HAVE_COIN3D
360  tracker.loadModel(input_directory + "/Models/chateau.wrl", input_directory + "/Models/chateau.cao");
361 #else
362  tracker.loadModel(input_directory + "/Models/chateau.cao", input_directory + "/Models/chateau.cao");
363 #endif
365  T[0][0] = -1;
366  T[0][3] = -0.2;
367  T[1][1] = 0;
368  T[1][2] = 1;
369  T[1][3] = 0.12;
370  T[2][1] = 1;
371  T[2][2] = 0;
372  T[2][3] = -0.15;
373  tracker.loadModel(input_directory + "/Models/cube.cao", false, T);
374  vpCameraParameters cam_color, cam_depth;
375  tracker.getCameraParameters(cam_color, cam_depth);
376  tracker.setDisplayFeatures(true);
377  tracker.setScanLineVisibilityTest(useScanline);
378 
379  std::map<int, std::pair<double, double> > map_thresh;
380  //Take the highest thresholds between all CI machines
381 #ifdef VISP_HAVE_COIN3D
383  = useScanline ? std::pair<double, double>(0.005, 3.9) : std::pair<double, double>(0.007, 2.9);
384 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
386  = useScanline ? std::pair<double, double>(0.006, 1.9) : std::pair<double, double>(0.005, 1.3);
388  = useScanline ? std::pair<double, double>(0.005, 3.2) : std::pair<double, double>(0.006, 2.8);
389 #endif
391  = useScanline ? std::pair<double, double>(0.003, 1.7) : std::pair<double, double>(0.002, 0.8);
392 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
394  = std::pair<double, double>(0.002, 0.3);
396  = useScanline ? std::pair<double, double>(0.002, 1.8) : std::pair<double, double>(0.002, 0.7);
397 #endif
398 #else
400  = useScanline ? std::pair<double, double>(0.007, 2.3) : std::pair<double, double>(0.007, 2.1);
401 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
403  = useScanline ? std::pair<double, double>(0.006, 1.7) : std::pair<double, double>(0.005, 1.4);
405  = useScanline ? std::pair<double, double>(0.004, 1.2) : std::pair<double, double>(0.004, 1.0);
406 #endif
408  = useScanline ? std::pair<double, double>(0.002, 0.7) : std::pair<double, double>(0.001, 0.4);
409 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
411  = std::pair<double, double>(0.002, 0.3);
413  = useScanline ? std::pair<double, double>(0.001, 0.5) : std::pair<double, double>(0.001, 0.4);
414 #endif
415 #endif
416 
417  vpImage<unsigned char> I, I_depth;
418  vpImage<uint16_t> I_depth_raw;
419  vpHomogeneousMatrix cMo_truth;
420  std::vector<vpColVector> pointcloud;
421  int cpt_frame = 1;
422  if (!read_data(input_directory, cpt_frame, cam_depth, I, I_depth_raw, pointcloud, cMo_truth)) {
423  std::cerr << "Cannot read first frame!" << std::endl;
424  return EXIT_FAILURE;
425  }
426 
427  vpImage<bool> mask(I.getHeight(), I.getWidth());
428  const double roi_step = 7.0;
429  const double roi_step2 = 6.0;
430  if (use_mask) {
431  mask = false;
432  for (unsigned int i = (unsigned int) (I.getRows()/roi_step); i < (unsigned int) (I.getRows()*roi_step2/roi_step); i++) {
433  for (unsigned int j = (unsigned int) (I.getCols()/roi_step); j < (unsigned int) (I.getCols()*roi_step2/roi_step); j++) {
434  mask[i][j] = true;
435  }
436  }
437  tracker.setMask(mask);
438  }
439 
440  vpImageConvert::createDepthHistogram(I_depth_raw, I_depth);
441  if (opt_display) {
442 #ifdef VISP_HAVE_DISPLAY
443  display1.init(I, 0, 0, "Image");
444  display2.init(I_depth, I.getWidth(), 0, "Depth");
445 #endif
446  }
447 
448  vpHomogeneousMatrix depth_M_color;
449  depth_M_color[0][3] = -0.05;
450  tracker.setCameraTransformationMatrix("Camera2", depth_M_color);
451  tracker.initFromPose(I, cMo_truth);
452 
453  bool click = false, quit = false;
454  std::vector<double> vec_err_t, vec_err_tu;
455  std::vector<double> time_vec;
456  while (read_data(input_directory, cpt_frame, cam_depth, I, I_depth_raw, pointcloud, cMo_truth) && !quit
457  && (opt_lastFrame > 0 ? (int)cpt_frame <= opt_lastFrame : true)) {
458  vpImageConvert::createDepthHistogram(I_depth_raw, I_depth);
459 
460  if (opt_display) {
462  vpDisplay::display(I_depth);
463  }
464 
465  double t = vpTime::measureTimeMs();
466  std::map<std::string, const vpImage<unsigned char> *> mapOfImages;
467  mapOfImages["Camera1"] = &I;
468  std::map<std::string, const std::vector<vpColVector> *> mapOfPointclouds;
469  mapOfPointclouds["Camera2"] = &pointcloud;
470  std::map<std::string, unsigned int> mapOfWidths, mapOfHeights;
471  if (!use_depth) {
472  mapOfWidths["Camera2"] = 0;
473  mapOfHeights["Camera2"] = 0;
474  } else {
475  mapOfWidths["Camera2"] = I_depth.getWidth();
476  mapOfHeights["Camera2"] = I_depth.getHeight();
477  }
478 
479  tracker.track(mapOfImages, mapOfPointclouds, mapOfWidths, mapOfHeights);
480  vpHomogeneousMatrix cMo = tracker.getPose();
481  t = vpTime::measureTimeMs() - t;
482  time_vec.push_back(t);
483 
484  if (opt_display) {
485  tracker.display(I, I_depth, cMo, depth_M_color*cMo, cam_color, cam_depth, vpColor::red, 3);
486  vpDisplay::displayFrame(I, cMo, cam_depth, 0.05, vpColor::none, 3);
487  vpDisplay::displayFrame(I_depth, depth_M_color*cMo, cam_depth, 0.05, vpColor::none, 3);
488 
489  std::stringstream ss;
490  ss << "Frame: " << cpt_frame;
491  vpDisplay::displayText(I_depth, 20, 20, ss.str(), vpColor::red);
492  ss.str("");
493  ss << "Nb features: " << tracker.getError().getRows();
494  vpDisplay::displayText(I_depth, 40, 20, ss.str(), vpColor::red);
495  }
496 
497  vpPoseVector pose_est(cMo);
498  vpPoseVector pose_truth(cMo_truth);
499  vpColVector t_est(3), t_truth(3);
500  vpColVector tu_est(3), tu_truth(3);
501  for (int i = 0; i < 3; i++) {
502  t_est[i] = pose_est[i];
503  t_truth[i] = pose_truth[i];
504  tu_est[i] = pose_est[i+3];
505  tu_truth[i] = pose_truth[i+3];
506  }
507 
508  vpColVector t_err = t_truth-t_est, tu_err = tu_truth-tu_est;
509  const double t_thresh = map_thresh[!use_depth ? trackerType_image : trackerType_image | vpMbGenericTracker::DEPTH_DENSE_TRACKER].first;
510  const double tu_thresh = map_thresh[!use_depth ? trackerType_image : trackerType_image | vpMbGenericTracker::DEPTH_DENSE_TRACKER].second;
511  double t_err2 = sqrt(t_err.sumSquare()), tu_err2 = vpMath::deg(sqrt(tu_err.sumSquare()));
512  vec_err_t.push_back( t_err2 );
513  vec_err_tu.push_back( tu_err2 );
514  if ( !use_mask && (t_err2 > t_thresh || tu_err2 > tu_thresh) ) { //no accuracy test with mask
515  std::cerr << "Pose estimated exceeds the threshold (t_thresh = " << t_thresh << " ; tu_thresh = " << tu_thresh << ")!" << std::endl;
516  std::cout << "t_err: " << t_err2 << " ; tu_err: " << tu_err2 << std::endl;
517  return EXIT_FAILURE;
518  }
519 
520  if (opt_display) {
521  if (use_mask) {
522  vpRect roi(vpImagePoint(I.getRows()/roi_step, I.getCols()/roi_step),
523  vpImagePoint(I.getRows()*roi_step2/roi_step, I.getCols()*roi_step2/roi_step));
526  }
527 
528  vpDisplay::flush(I);
529  vpDisplay::flush(I_depth);
530  }
531 
532  if (opt_display && opt_click_allowed) {
534  if (vpDisplay::getClick(I, button, click)) {
535  switch (button) {
537  quit = !click;
538  break;
539 
541  click = !click;
542  break;
543 
544  default:
545  break;
546  }
547  }
548  }
549 
550  cpt_frame++;
551  }
552 
553  if (!time_vec.empty())
554  std::cout << "Computation time, Mean: " << vpMath::getMean(time_vec) << " ms ; Median: " << vpMath::getMedian(time_vec)
555  << " ms ; Std: " << vpMath::getStdev(time_vec) << " ms" << std::endl;
556 
557  if (!vec_err_t.empty())
558  std::cout << "Max translation error: " << *std::max_element(vec_err_t.begin(), vec_err_t.end()) << std::endl;
559 
560  if (!vec_err_tu.empty())
561  std::cout << "Max thetau error: " << *std::max_element(vec_err_tu.begin(), vec_err_tu.end()) << std::endl;
562 
563 #if defined(VISP_HAVE_XML2)
564  // Cleanup memory allocated by xml library used to parse the xml config
565  // file in vpMbGenericTracker::loadConfigFile()
567 #endif
568 
569 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 2 || COIN_MAJOR_VERSION == 3)
570  // Cleanup memory allocated by Coin library used to load a vrml model. We clean only if Coin was used.
571  SoDB::finish();
572 #endif
573 
574  return EXIT_SUCCESS;
575  } catch (const vpException &e) {
576  std::cout << "Catch an exception: " << e << std::endl;
577  return EXIT_FAILURE;
578  }
579 }
580 #else
581 int main() {
582  std::cout << "Enable MBT module (VISP_HAVE_MODULE_MBT) to launch this test." << std::endl;
583  return 0;
584 }
585 #endif
unsigned int getCols() const
Definition: vpImage.h:169
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static double getStdev(const std::vector< double > &v, const bool useBesselCorrection=false)
Definition: vpMath.cpp:252
static bool checkDirectory(const char *dirname)
Definition: vpIoTools.cpp:467
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.
void setMaskNumber(const unsigned int &a)
Definition: vpMe.cpp:454
static void readBinaryValueLE(std::ifstream &file, int16_t &short_value)
Definition: vpIoTools.cpp:1864
static double getMedian(const std::vector< double > &v)
Definition: vpMath.cpp:222
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:129
void setMaxFeatures(const int maxCount)
void setSampleStep(const double &s)
Definition: vpMe.h:278
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
static const vpColor none
Definition: vpColor.h:192
void setMinDistance(double minDistance)
error that can be emited by ViSP classes.
Definition: vpException.h:71
Definition: vpMe.h:60
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Real-time 6D object pose tracking using its CAD model.
static void flush(const vpImage< unsigned char > &I)
VISP_EXPORT double measureTimeMs()
Definition: vpTime.cpp:88
void setMu1(const double &mu_1)
Definition: vpMe.h:241
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)
static bool checkFilename(const char *filename)
Definition: vpIoTools.cpp:675
static double getMean(const std::vector< double > &v)
Definition: vpMath.cpp:202
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed...
Definition: vpDisplayD3D.h:107
unsigned int getRows() const
Definition: vpImage.h:211
static std::string createFilePath(const std::string &parent, const std::string &child)
Definition: vpIoTools.cpp:1541
void setMaskSize(const unsigned int &a)
Definition: vpMe.cpp:461
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 resize(const unsigned int h, const unsigned int w)
resize the image : Image initialization
Definition: vpImage.h:866
static void displayRectangle(const vpImage< unsigned char > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
void setPyramidLevels(const int pyrMaxLevel)
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="")
double sumSquare() const
static void cleanup()
Definition: vpXmlParser.h:310
void setMu2(const double &mu_2)
Definition: vpMe.h:248
void setWindowSize(const int winSize)
static double deg(double rad)
Definition: vpMath.h:95
static void read(vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:207
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
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))
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:92
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)
void setThreshold(const double &t)
Definition: vpMe.h:300
unsigned int getHeight() const
Definition: vpImage.h:178
Defines a rectangle in the plane.
Definition: vpRect.h:78
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
void setRange(const unsigned int &r)
Definition: vpMe.h:271
static const vpColor yellow
Definition: vpColor.h:188
static void createDepthHistogram(const vpImage< uint16_t > &src_depth, vpImage< vpRGBa > &dest_rgba)