Visual Servoing Platform  version 3.6.1 under development (2024-05-18)
testGenericTrackerDepth.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  * Regression test for depth MBT.
33  *
34 *****************************************************************************/
35 
42 #include <cstdlib>
43 #include <iostream>
44 #include <visp3/core/vpConfig.h>
45 
46 #if defined(VISP_HAVE_MODULE_MBT) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
47 
48 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
49 #include <type_traits>
50 #endif
51 
52 #include <visp3/core/vpIoTools.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/mbt/vpMbGenericTracker.h>
61 
62 #define GETOPTARGS "i:dcle:mCh"
63 
64 namespace
65 {
66 void usage(const char *name, const char *badparam)
67 {
68  fprintf(stdout, "\n\
69  Regression test for vpGenericTracker and depth.\n\
70  \n\
71  SYNOPSIS\n\
72  %s [-i <test image path>] [-c] [-d] [-h] [-l] \n\
73  [-e <last frame index>] [-m] [-C]\n",
74  name);
75 
76  fprintf(stdout, "\n\
77  OPTIONS: \n\
78  -i <input image path> \n\
79  Set image input path.\n\
80  These images come from ViSP-images-x.y.z.tar.gz available \n\
81  on the ViSP website.\n\
82  Setting the VISP_INPUT_IMAGE_PATH environment\n\
83  variable produces the same behavior than using\n\
84  this option.\n\
85  \n\
86  -d \n\
87  Turn off the display.\n\
88  \n\
89  -c\n\
90  Disable the mouse click. Useful to automate the \n\
91  execution of this program without human intervention.\n\
92  \n\
93  -l\n\
94  Use the scanline for visibility tests.\n\
95  \n\
96  -e <last frame index>\n\
97  Specify the index of the last frame. Once reached, the tracking is stopped.\n\
98  \n\
99  -m \n\
100  Set a tracking mask.\n\
101  \n\
102  -C \n\
103  Use color images.\n\
104  \n\
105  -h \n\
106  Print the help.\n\n");
107 
108  if (badparam)
109  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
110 }
111 
112 bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display, bool &useScanline,
113  int &lastFrame, bool &use_mask, bool &use_color_image)
114 {
115  const char *optarg_;
116  int c;
117  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
118 
119  switch (c) {
120  case 'i':
121  ipath = optarg_;
122  break;
123  case 'c':
124  click_allowed = false;
125  break;
126  case 'd':
127  display = false;
128  break;
129  case 'l':
130  useScanline = true;
131  break;
132  case 'e':
133  lastFrame = atoi(optarg_);
134  break;
135  case 'm':
136  use_mask = true;
137  break;
138  case 'C':
139  use_color_image = true;
140  break;
141  case 'h':
142  usage(argv[0], nullptr);
143  return false;
144  break;
145 
146  default:
147  usage(argv[0], optarg_);
148  return false;
149  break;
150  }
151  }
152 
153  if ((c == 1) || (c == -1)) {
154  // standalone param or error
155  usage(argv[0], nullptr);
156  std::cerr << "ERROR: " << std::endl;
157  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
158  return false;
159  }
160 
161  return true;
162 }
163 
164 template <typename Type>
165 bool read_data(const std::string &input_directory, int cpt, const vpCameraParameters &cam_depth, vpImage<Type> &I,
166  vpImage<uint16_t> &I_depth, std::vector<vpColVector> &pointcloud, vpHomogeneousMatrix &cMo)
167 {
168 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
169  static_assert(std::is_same<Type, unsigned char>::value || std::is_same<Type, vpRGBa>::value,
170  "Template function supports only unsigned char and vpRGBa images!");
171 #endif
172 #if VISP_HAVE_DATASET_VERSION >= 0x030600
173  std::string ext("png");
174 #else
175  std::string ext("pgm");
176 #endif
177  char buffer[FILENAME_MAX];
178  snprintf(buffer, FILENAME_MAX, std::string(input_directory + "/Images/Image_%04d." + ext).c_str(), cpt);
179  std::string image_filename = buffer;
180 
181  snprintf(buffer, FILENAME_MAX, std::string(input_directory + "/Depth/Depth_%04d.bin").c_str(), cpt);
182  std::string depth_filename = buffer;
183 
184  snprintf(buffer, FILENAME_MAX, std::string(input_directory + "/CameraPose/Camera_%03d.txt").c_str(), cpt);
185  std::string pose_filename = buffer;
186 
187  if (!vpIoTools::checkFilename(image_filename) || !vpIoTools::checkFilename(depth_filename) ||
188  !vpIoTools::checkFilename(pose_filename))
189  return false;
190 
191  vpImageIo::read(I, image_filename);
192 
193  unsigned int depth_width = 0, depth_height = 0;
194  std::ifstream file_depth(depth_filename.c_str(), std::ios::in | std::ios::binary);
195  if (!file_depth.is_open())
196  return false;
197 
198  vpIoTools::readBinaryValueLE(file_depth, depth_height);
199  vpIoTools::readBinaryValueLE(file_depth, depth_width);
200  I_depth.resize(depth_height, depth_width);
201  pointcloud.resize(depth_height * depth_width);
202 
203  const float depth_scale = 0.000030518f;
204  for (unsigned int i = 0; i < I_depth.getHeight(); i++) {
205  for (unsigned int j = 0; j < I_depth.getWidth(); j++) {
206  vpIoTools::readBinaryValueLE(file_depth, I_depth[i][j]);
207  double x = 0.0, y = 0.0, Z = I_depth[i][j] * depth_scale;
208  vpPixelMeterConversion::convertPoint(cam_depth, j, i, x, y);
209  vpColVector pt3d(4, 1.0);
210  pt3d[0] = x * Z;
211  pt3d[1] = y * Z;
212  pt3d[2] = Z;
213  pointcloud[i * I_depth.getWidth() + j] = pt3d;
214  }
215  }
216 
217  std::ifstream file_pose(pose_filename.c_str());
218  if (!file_pose.is_open()) {
219  return false;
220  }
221 
222  for (unsigned int i = 0; i < 4; i++) {
223  for (unsigned int j = 0; j < 4; j++) {
224  file_pose >> cMo[i][j];
225  }
226  }
227 
228  return true;
229 }
230 
231 template <typename Type>
232 bool run(vpImage<Type> &I, const std::string &input_directory, bool opt_click_allowed, bool opt_display,
233  bool useScanline, int opt_lastFrame, bool use_mask)
234 {
235 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
236  static_assert(std::is_same<Type, unsigned char>::value || std::is_same<Type, vpRGBa>::value,
237  "Template function supports only unsigned char and vpRGBa images!");
238 #endif
239 // Initialise a display
240 #if defined(VISP_HAVE_X11)
241  vpDisplayX display1, display2;
242 #elif defined(VISP_HAVE_GDI)
243  vpDisplayGDI display1, display2;
244 #elif defined(HAVE_OPENCV_HIGHGUI)
245  vpDisplayOpenCV display1, display2;
246 #elif defined(VISP_HAVE_D3D9)
247  vpDisplayD3D display1, display2;
248 #elif defined(VISP_HAVE_GTK)
249  vpDisplayGTK display1, display2;
250 #else
251  opt_display = false;
252 #endif
253 
254  std::vector<int> tracker_type;
255  tracker_type.push_back(vpMbGenericTracker::DEPTH_DENSE_TRACKER);
256  vpMbGenericTracker tracker(tracker_type);
257 
258 #if defined(VISP_HAVE_PUGIXML)
259  tracker.loadConfigFile(input_directory + "/Config/chateau_depth.xml");
260 #else
261  // Corresponding parameters manually set to have an example code
262  {
263  vpCameraParameters cam_depth;
264  cam_depth.initPersProjWithoutDistortion(700.0, 700.0, 320.0, 240.0);
265  tracker.setCameraParameters(cam_depth);
266  }
267  // Depth
268  tracker.setDepthNormalFeatureEstimationMethod(vpMbtFaceDepthNormal::ROBUST_FEATURE_ESTIMATION);
269  tracker.setDepthNormalPclPlaneEstimationMethod(2);
270  tracker.setDepthNormalPclPlaneEstimationRansacMaxIter(200);
271  tracker.setDepthNormalPclPlaneEstimationRansacThreshold(0.001);
272  tracker.setDepthNormalSamplingStep(2, 2);
273 
274  tracker.setDepthDenseSamplingStep(4, 4);
275 
276 #if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
277  tracker.setKltMaskBorder(5);
278 #endif
279 
280  tracker.setAngleAppear(vpMath::rad(85.0));
281  tracker.setAngleDisappear(vpMath::rad(89.0));
282  tracker.setNearClippingDistance(0.01);
283  tracker.setFarClippingDistance(2.0);
284  tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING);
285 #endif
286  tracker.loadModel(input_directory + "/Models/chateau.cao");
288  T[0][0] = -1;
289  T[0][3] = -0.2;
290  T[1][1] = 0;
291  T[1][2] = 1;
292  T[1][3] = 0.12;
293  T[2][1] = 1;
294  T[2][2] = 0;
295  T[2][3] = -0.15;
296  tracker.loadModel(input_directory + "/Models/cube.cao", false, T);
297  vpCameraParameters cam_depth;
298  tracker.getCameraParameters(cam_depth);
299  tracker.setDisplayFeatures(true);
300  tracker.setScanLineVisibilityTest(useScanline);
301 
302  vpImage<uint16_t> I_depth_raw;
303  vpImage<vpRGBa> I_depth;
304  vpHomogeneousMatrix cMo_truth;
305  std::vector<vpColVector> pointcloud;
306  int cpt_frame = 1;
307  if (!read_data(input_directory, cpt_frame, cam_depth, I, I_depth_raw, pointcloud, cMo_truth)) {
308  std::cerr << "Cannot read first frame!" << std::endl;
309  return EXIT_FAILURE;
310  }
311 
312  vpImage<bool> mask(I.getHeight(), I.getWidth());
313  const double roi_step = 7.0;
314  const double roi_step2 = 6.0;
315  if (use_mask) {
316  mask = false;
317  for (unsigned int i = (unsigned int)(I.getRows() / roi_step);
318  i < (unsigned int)(I.getRows() * roi_step2 / roi_step); i++) {
319  for (unsigned int j = (unsigned int)(I.getCols() / roi_step);
320  j < (unsigned int)(I.getCols() * roi_step2 / roi_step); j++) {
321  mask[i][j] = true;
322  }
323  }
324  tracker.setMask(mask);
325  }
326 
327  vpImageConvert::createDepthHistogram(I_depth_raw, I_depth);
328  if (opt_display) {
329 #ifdef VISP_HAVE_DISPLAY
330  display1.init(I, 0, 0, "Image");
331  display2.init(I_depth, (int)I.getWidth(), 0, "Depth");
332 #endif
333  }
334 
335  vpHomogeneousMatrix depth_M_color;
336  depth_M_color[0][3] = -0.05;
337  tracker.initFromPose(I, depth_M_color * cMo_truth);
338 
339  bool click = false, quit = false, correct_accuracy = true;
340  std::vector<double> vec_err_t, vec_err_tu;
341  std::vector<double> time_vec;
342  while (read_data(input_directory, cpt_frame, cam_depth, I, I_depth_raw, pointcloud, cMo_truth) && !quit &&
343  (opt_lastFrame > 0 ? (int)cpt_frame <= opt_lastFrame : true)) {
344  vpImageConvert::createDepthHistogram(I_depth_raw, I_depth);
345 
346  if (opt_display) {
348  vpDisplay::display(I_depth);
349  }
350 
351  double t = vpTime::measureTimeMs();
352  std::map<std::string, const vpImage<Type> *> mapOfImages;
353  std::map<std::string, const std::vector<vpColVector> *> mapOfPointclouds;
354  mapOfPointclouds["Camera"] = &pointcloud;
355  std::map<std::string, unsigned int> mapOfWidths, mapOfHeights;
356  mapOfWidths["Camera"] = I_depth.getWidth();
357  mapOfHeights["Camera"] = I_depth.getHeight();
358 
359  tracker.track(mapOfImages, mapOfPointclouds, mapOfWidths, mapOfHeights);
360  vpHomogeneousMatrix cMo = tracker.getPose();
361  t = vpTime::measureTimeMs() - t;
362  time_vec.push_back(t);
363 
364  if (opt_display) {
365  tracker.display(I_depth, cMo, cam_depth, vpColor::red, 3);
366  vpDisplay::displayFrame(I_depth, cMo, cam_depth, 0.05, vpColor::none, 3);
367 
368  std::stringstream ss;
369  ss << "Frame: " << cpt_frame;
370  vpDisplay::displayText(I_depth, 20, 20, ss.str(), vpColor::red);
371  ss.str("");
372  ss << "Nb features: " << tracker.getError().getRows();
373  vpDisplay::displayText(I_depth, 40, 20, ss.str(), vpColor::red);
374  }
375 
376  vpPoseVector pose_est(cMo);
377  vpPoseVector pose_truth(depth_M_color * cMo_truth);
378  vpColVector t_est(3), t_truth(3);
379  vpColVector tu_est(3), tu_truth(3);
380  for (unsigned int i = 0; i < 3; i++) {
381  t_est[i] = pose_est[i];
382  t_truth[i] = pose_truth[i];
383  tu_est[i] = pose_est[i + 3];
384  tu_truth[i] = pose_truth[i + 3];
385  }
386 
387  vpColVector t_err = t_truth - t_est, tu_err = tu_truth - tu_est;
388  double t_err2 = sqrt(t_err.sumSquare()), tu_err2 = vpMath::deg(sqrt(tu_err.sumSquare()));
389  vec_err_t.push_back(t_err2);
390  vec_err_tu.push_back(tu_err2);
391  const double t_thresh = useScanline ? 0.003 : 0.002;
392  const double tu_thresh = useScanline ? 0.5 : 0.4;
393  if (!use_mask && (t_err2 > t_thresh || tu_err2 > tu_thresh)) { // no accuracy test with mask
394  std::cerr << "Pose estimated exceeds the threshold (t_thresh = " << t_thresh << ", tu_thresh = " << tu_thresh
395  << ")!" << std::endl;
396  std::cout << "t_err: " << t_err2 << " ; tu_err: " << tu_err2 << std::endl;
397  correct_accuracy = false;
398  }
399 
400  if (opt_display) {
401  if (use_mask) {
402  vpRect roi(vpImagePoint(I.getRows() / roi_step, I.getCols() / roi_step),
403  vpImagePoint(I.getRows() * roi_step2 / roi_step, I.getCols() * roi_step2 / roi_step));
405  }
406 
407  vpDisplay::flush(I);
408  vpDisplay::flush(I_depth);
409  }
410 
411  if (opt_display && opt_click_allowed) {
413  if (vpDisplay::getClick(I, button, click)) {
414  switch (button) {
416  quit = !click;
417  break;
418 
420  click = !click;
421  break;
422 
423  default:
424  break;
425  }
426  }
427  }
428 
429  cpt_frame++;
430  }
431 
432  if (!time_vec.empty())
433  std::cout << "Computation time, Mean: " << vpMath::getMean(time_vec)
434  << " ms ; Median: " << vpMath::getMedian(time_vec) << " ms ; Std: " << vpMath::getStdev(time_vec) << " ms"
435  << std::endl;
436 
437  if (!vec_err_t.empty())
438  std::cout << "Max translation error: " << *std::max_element(vec_err_t.begin(), vec_err_t.end()) << std::endl;
439 
440  if (!vec_err_tu.empty())
441  std::cout << "Max thetau error: " << *std::max_element(vec_err_tu.begin(), vec_err_tu.end()) << std::endl;
442 
443  return correct_accuracy ? EXIT_SUCCESS : EXIT_FAILURE;
444 }
445 } // namespace
446 
447 int main(int argc, const char *argv[])
448 {
449  try {
450  std::string env_ipath;
451  std::string opt_ipath = "";
452  bool opt_click_allowed = true;
453  bool opt_display = true;
454  bool useScanline = false;
455 #if defined(__mips__) || defined(__mips) || defined(mips) || defined(__MIPS__)
456  // To avoid Debian test timeout
457  int opt_lastFrame = 5;
458 #else
459  int opt_lastFrame = -1;
460 #endif
461  bool use_mask = false;
462  bool use_color_image = false;
463 
464  // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH
465  // environment variable value
466  env_ipath = vpIoTools::getViSPImagesDataPath();
467 
468  // Read the command line options
469  if (!getOptions(argc, argv, opt_ipath, opt_click_allowed, opt_display, useScanline, opt_lastFrame, use_mask,
470  use_color_image)) {
471  return EXIT_FAILURE;
472  }
473 
474  std::cout << "useScanline: " << useScanline << std::endl;
475  std::cout << "use_mask: " << use_mask << std::endl;
476  std::cout << "use_color_image: " << use_color_image << std::endl;
477 
478  // Test if an input path is set
479  if (opt_ipath.empty() && env_ipath.empty()) {
480  usage(argv[0], nullptr);
481  std::cerr << std::endl << "ERROR:" << std::endl;
482  std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " << std::endl
483  << " environment variable to specify the location of the " << std::endl
484  << " image path where test images are located." << std::endl
485  << std::endl;
486 
487  return EXIT_FAILURE;
488  }
489 
490  std::string input_directory =
491  vpIoTools::createFilePath(!opt_ipath.empty() ? opt_ipath : env_ipath, "mbt-depth/Castle-simu");
492  if (!vpIoTools::checkDirectory(input_directory)) {
493  std::cerr << "ViSP-images does not contain the folder: " << input_directory << "!" << std::endl;
494  return EXIT_SUCCESS;
495  }
496 
497  if (use_color_image) {
498  vpImage<vpRGBa> I_color;
499  return run(I_color, input_directory, opt_click_allowed, opt_display, useScanline, opt_lastFrame, use_mask);
500  }
501  else {
502  vpImage<unsigned char> I_gray;
503  return run(I_gray, input_directory, opt_click_allowed, opt_display, useScanline, opt_lastFrame, use_mask);
504  }
505  }
506  catch (const vpException &e) {
507  std::cout << "Catch an exception: " << e << std::endl;
508  return EXIT_FAILURE;
509  }
510 }
511 #elif !(defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
512 int main()
513 {
514  std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
515  return EXIT_SUCCESS;
516 }
517 #else
518 int main()
519 {
520  std::cout << "Enable MBT module (VISP_HAVE_MODULE_MBT) to launch this test." << std::endl;
521  return EXIT_SUCCESS;
522 }
523 #endif
Generic class defining intrinsic camera parameters.
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
Implementation of column vector and the associated operations.
Definition: vpColVector.h:163
double sumSquare() const
static const vpColor red
Definition: vpColor.h:211
static const vpColor none
Definition: vpColor.h:223
static const vpColor yellow
Definition: vpColor.h:219
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed....
Definition: vpDisplayD3D.h:101
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:128
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
Definition: vpDisplayGTK.h:128
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:128
void init(vpImage< unsigned char > &I, int win_x=-1, int win_y=-1, const std::string &win_title="") vp_override
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 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)
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:59
Implementation of an homogeneous matrix and operations on such kind of matrices.
static void createDepthHistogram(const vpImage< uint16_t > &src_depth, vpImage< vpRGBa > &dest_rgba)
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition: vpImageIo.cpp:143
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:82
Definition of the vpImage class member functions.
Definition: vpImage.h:69
unsigned int getWidth() const
Definition: vpImage.h:245
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
Definition: vpImage.h:798
unsigned int getCols() const
Definition: vpImage.h:175
unsigned int getHeight() const
Definition: vpImage.h:184
unsigned int getRows() const
Definition: vpImage.h:215
static std::string getViSPImagesDataPath()
Definition: vpIoTools.cpp:1834
static bool checkFilename(const std::string &filename)
Definition: vpIoTools.cpp:1215
static void readBinaryValueLE(std::ifstream &file, int16_t &short_value)
Definition: vpIoTools.cpp:2522
static bool checkDirectory(const std::string &dirname)
Definition: vpIoTools.cpp:834
static std::string createFilePath(const std::string &parent, const std::string &child)
Definition: vpIoTools.cpp:2197
static double rad(double deg)
Definition: vpMath.h:127
static double getMedian(const std::vector< double > &v)
Definition: vpMath.cpp:323
static double getStdev(const std::vector< double > &v, bool useBesselCorrection=false)
Definition: vpMath.cpp:354
static double getMean(const std::vector< double > &v)
Definition: vpMath.cpp:303
static double deg(double rad)
Definition: vpMath.h:117
Real-time 6D object pose tracking using its CAD model.
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:69
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:189
Defines a rectangle in the plane.
Definition: vpRect.h:76
void display(vpImage< unsigned char > &I, const std::string &title)
Display a gray-scale image.
VISP_EXPORT double measureTimeMs()