Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
tutorial-pf-curve-fitting-pf.cpp
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2024 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
32
33#include <visp3/core/vpConfig.h>
34#include <visp3/core/vpException.h>
35#include <visp3/core/vpMath.h>
36#include <visp3/core/vpMouseButton.h>
37#include <visp3/core/vpTime.h>
38#include <visp3/core/vpUniRand.h>
39
40#ifdef VISP_HAVE_DISPLAY
41#include <visp3/gui/vpPlot.h>
42#endif
43
45#include <visp3/core/vpParticleFilter.h>
47
48#include "vpTutoCommonData.h"
49#include "vpTutoMeanSquareFitting.h"
50#include "vpTutoParabolaModel.h"
51#include "vpTutoSegmentation.h"
52
53#ifdef ENABLE_VISP_NAMESPACE
54using namespace VISP_NAMESPACE_NAME;
55#endif
56
57#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY)
58#ifndef DOXYGEN_SHOULD_SKIP_THIS
59namespace tutorial
60{
62
69double evaluate(const vpImagePoint &pt, const vpTutoParabolaModel &model)
70{
71 double u = pt.get_u();
72 double v = pt.get_v();
73 double v_model = model.eval(u);
74 double error = v - v_model;
75 double squareError = error * error;
76 return squareError;
77}
78
89double evaluate(const vpColVector &coeffs, const unsigned int &height, const unsigned int &width, const std::vector<vpImagePoint> &pts)
90{
91 unsigned int nbPts = static_cast<unsigned int>(pts.size());
92 vpColVector residuals(nbPts);
93 vpColVector weights(nbPts, 1.);
94 vpTutoParabolaModel model(coeffs, height, width);
95 // Compute the residuals
96 for (unsigned int i = 0; i < nbPts; ++i) {
97 double squareError = evaluate(pts[i], model);
98 residuals[i] = squareError;
99 }
100 double meanSquareError = residuals.sum() / static_cast<double>(nbPts);
101 return std::sqrt(meanSquareError);
102}
104
106
114template<typename T>
115void display(const vpColVector &coeffs, const vpImage<T> &I, const vpColor &color,
116 const unsigned int &vertPosLegend, const unsigned int &horPosLegend)
117{
118#if defined(VISP_HAVE_DISPLAY)
119 unsigned int width = I.getWidth();
120 vpTutoParabolaModel model(coeffs, I.getHeight(), I.getWidth());
121 for (unsigned int u = 0; u < width; ++u) {
122 double v = model.eval(u);
123 vpDisplay::displayPoint(I, static_cast<int>(v), static_cast<int>(u), color, 1);
124 vpDisplay::displayText(I, vertPosLegend, horPosLegend, "Particle Filter model", color);
125 }
126#else
127 (void)coeffs;
128 (void)I;
129 (void)color;
130 (void)vertPosLegend;
131 (void)horPosLegend;
132#endif
133}
135
137
144std::vector<vpImagePoint> automaticInitialization(tutorial::vpTutoCommonData &data)
145{
146 // Initialization-related variables
147 const unsigned int minNbPts = data.m_degree + 1;
148 const unsigned int nbPtsToUse = 10 * minNbPts;
149 std::vector<vpImagePoint> initPoints;
150
151 // Perform HSV segmentation
152 tutorial::performSegmentationHSV(data);
153
154 // Extracting the skeleton of the mask
155 std::vector<vpImagePoint> edgePoints = tutorial::extractSkeleton(data);
156 unsigned int nbEdgePoints = static_cast<unsigned int>(edgePoints.size());
157
158 if (nbEdgePoints < nbPtsToUse) {
159 return edgePoints;
160 }
161
162 // Uniformly extract init points
163 auto ptHasLowerU = [](const vpImagePoint &ptA, const vpImagePoint &ptB) {
164 return ptA.get_u() < ptB.get_u();
165 };
166 std::sort(edgePoints.begin(), edgePoints.end(), ptHasLowerU);
167
168 unsigned int idStart, idStop;
169 if (nbEdgePoints > nbPtsToUse + 20) {
170 // Avoid extreme points in case it's noise
171 idStart = 10;
172 idStop = static_cast<unsigned int>(edgePoints.size()) - 10;
173 }
174 else {
175 // We need to take all the points because we don't have enough
176 idStart = 0;
177 idStop = static_cast<unsigned int>(edgePoints.size());
178 }
179
180 // Sample uniformly the points starting from the left of the image to the right
181 unsigned int sizeWindow = idStop - idStart + 1;
182 unsigned int step = sizeWindow / (nbPtsToUse - 1);
183 for (unsigned int id = idStart; id <= idStop; id += step) {
184 initPoints.push_back(edgePoints[id]);
185 }
186 return initPoints;
187}
188
195std::vector<vpImagePoint> manualInitialization(const tutorial::vpTutoCommonData &data)
196{
197 // Interaction variables
198 const bool waitForClick = true;
199 vpImagePoint ipClick;
201
202 // Display variables
203 const unsigned int sizeCross = 10;
204 const unsigned int thicknessCross = 2;
205 const vpColor colorCross = vpColor::red;
206
207 // Initialization-related variables
208 const unsigned int minNbPts = data.m_degree + 1;
209 std::vector<vpImagePoint> initPoints;
210
211 bool notEnoughPoints = true;
212 while (notEnoughPoints) {
213 // Initial display of the images
214 vpDisplay::display(data.m_I_orig);
215
216 // Display the how-to
217 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend, "Left click to add init point (min.: " + std::to_string(minNbPts) + "), right click to estimate the initial coefficients of the Particle Filter.", data.m_colorLegend);
218 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend + data.m_legendOffset, "A middle click reinitialize the list of init points.", data.m_colorLegend);
219 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend + data.m_legendOffset + data.m_legendOffset, "If not enough points have been selected, a right click has no effect.", data.m_colorLegend);
220
221 // Display the already selected points
222 unsigned int nbInitPoints = static_cast<unsigned int>(initPoints.size());
223 for (unsigned int i = 0; i < nbInitPoints; ++i) {
224 vpDisplay::displayCross(data.m_I_orig, initPoints[i], sizeCross, colorCross, thicknessCross);
225 }
226
227 // Update the display
228 vpDisplay::flush(data.m_I_orig);
229
230 // Get the user input
231 vpDisplay::getClick(data.m_I_orig, ipClick, button, waitForClick);
232
233 // Either add the clicked point to the list of initial points or stop the loop if enough points are available
234 switch (button) {
236 initPoints.push_back(ipClick);
237 break;
239 initPoints.clear();
240 break;
242 (initPoints.size() >= minNbPts ? notEnoughPoints = false : notEnoughPoints = true);
243 break;
244 default:
245 break;
246 }
247 }
248
249 return initPoints;
250}
251
260vpColVector computeInitialGuess(tutorial::vpTutoCommonData &data)
261{
262 // Vector that contains the init points
263 std::vector<vpImagePoint> initPoints;
264
265#ifdef VISP_HAVE_DISPLAY
266 // Interaction variables
267 const bool waitForClick = true;
268 vpImagePoint ipClick;
270
271 // Display variables
272 const unsigned int sizeCross = 10;
273 const unsigned int thicknessCross = 2;
274 const vpColor colorCross = vpColor::red;
275
276 bool automaticInit = false;
277
278 // Initial display of the images
279 vpDisplay::display(data.m_I_orig);
280 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend, "Left click to manually select the init points, right click to automatically initialize the PF", data.m_colorLegend);
281
282 // Update the display
283 vpDisplay::flush(data.m_I_orig);
284
285 // Get the user input
286 vpDisplay::getClick(data.m_I_orig, ipClick, button, waitForClick);
287
288 // Either use the automatic initialization or the manual one depending on the user input
289 switch (button) {
291 automaticInit = false;
292 break;
294 automaticInit = true;
295 break;
296 default:
297 break;
298 }
299
300 if (automaticInit) {
301 // Get automatically the init points from the segmented image
302 initPoints = tutorial::automaticInitialization(data);
303 }
304 else {
305 // Get manually the init points from the original image
306 initPoints = tutorial::manualInitialization(data);
307 }
308
309#else
310 // Get the init points from the segmented image
311 initPoints = tutorial::automaticInitialization(data);
312#endif
313
314 // Compute the coefficients of the parabola using Least-Mean-Square minimization.
315 tutorial::vpTutoMeanSquareFitting lmsFitter(data.m_degree, data.m_I_orig.getHeight(), data.m_I_orig.getWidth());
316 lmsFitter.fit(initPoints);
317 vpColVector X0 = lmsFitter.getCoeffs();
318 std::cout << "---[Initial fit]---" << std::endl;
319 std::cout << lmsFitter.getModel();
320 std::cout << "---[Initial fit]---" << std::endl;
321
322 // Display info about the initialization
323 vpDisplay::display(data.m_I_orig);
324 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend, "Here are the points selected for the initialization.", data.m_colorLegend);
325 unsigned int nbInitPoints = static_cast<unsigned int>(initPoints.size());
326 for (unsigned int i = 0; i < nbInitPoints; ++i) {
327 const vpImagePoint &ip = initPoints[i];
328 vpDisplay::displayCross(data.m_I_orig, ip, sizeCross, colorCross, thicknessCross);
329 }
330
331 // Update display and wait for click
332 lmsFitter.display(data.m_I_orig, vpColor::red, static_cast<unsigned int>(data.m_ipLegend.get_v() + 2 * data.m_legendOffset.get_v()), static_cast<unsigned int>(data.m_ipLegend.get_u()));
333 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend + data.m_legendOffset, "A click to continue.", data.m_colorLegend);
334 vpDisplay::flush(data.m_I_orig);
335 vpDisplay::getClick(data.m_I_orig, waitForClick);
336
337 return X0;
338}
340
342vpColVector fx(const vpColVector &coeffs, const double &/*dt*/)
343{
344 vpColVector updatedCoeffs = coeffs; // We use a constant position model
345 return updatedCoeffs;
346}
348
350class vpTutoAverageFunctor
351{
352public:
353 vpTutoAverageFunctor(const unsigned int &degree, const unsigned int &height, const unsigned int &width)
354 : m_degree(degree)
355 , m_height(height)
356 , m_width(width)
357 { }
358
368 vpColVector averagePolynomials(const std::vector<vpColVector> &particles, const std::vector<double> &weights, const vpParticleFilter<std::vector<vpImagePoint>>::vpStateAddFunction &/**/)
369 {
370 const unsigned int nbParticles = static_cast<unsigned int>(particles.size());
371 const double nbParticlesAsDOuble = static_cast<double>(nbParticles);
372 // Compute the sum of the weights to be able to determine the "importance" of a particle with regard to the whole set
373 const double sumWeight = std::accumulate(weights.begin(), weights.end(), 0.);
374
375 // Defining the total number of control points we want to generate
376 const double nbPointsForAverage = 10. * nbParticlesAsDOuble;
377 std::vector<vpImagePoint> initPoints;
378
379 // Creating control points by each particle
380 for (unsigned int i = 0; i < nbParticles; ++i) {
381 // The number of control points a particle can generate is proportional to the ratio of its weight w.r.t. the sum of the weights
382 double nbPoints = std::floor(weights[i] * nbPointsForAverage / sumWeight);
383 if (nbPoints > 1.) {
384 // The particle has a weight high enough to deserve more than one points
385 vpTutoParabolaModel curve(particles[i], m_height, m_width);
386 double widthAsDouble = static_cast<double>(m_width);
387 // Uniform sampling of the control points along the polynomial model
388 double step = widthAsDouble / (nbPoints - 1.);
389 for (double u = 0.; u < widthAsDouble; u += step) {
390 double v = curve.eval(u);
391 vpImagePoint pt(v, u);
392 initPoints.push_back(pt);
393 }
394 }
395 else if (vpMath::equal(nbPoints, 1.)) {
396 // The weight of the particle make it have only one control point
397 // We sample it at the middle of the image
398 vpTutoParabolaModel curve(particles[i], m_height, m_width);
399 double u = static_cast<double>(m_width) / 2.;
400 double v = curve.eval(u);
401 vpImagePoint pt(v, u);
402 initPoints.push_back(pt);
403 }
404 }
405 // We use Least-Mean Square minimization to compute the polynomial model that best fits all the control points
406 vpTutoMeanSquareFitting lms(m_degree, m_height, m_width);
407 lms.fit(initPoints);
408 return lms.getCoeffs();
409 }
410
411private:
412 unsigned int m_degree;
413 unsigned int m_height;
414 unsigned int m_width;
415};
417
419class vpTutoLikelihoodFunctor
420{
421public:
429 vpTutoLikelihoodFunctor(const double &stdev, const unsigned int &height, const unsigned int &width)
430 : m_height(height)
431 , m_width(width)
432 {
433 double sigmaDistanceSquared = stdev * stdev;
434 m_constantDenominator = 1. / std::sqrt(2. * M_PI * sigmaDistanceSquared);
435 m_constantExpDenominator = -1. / (2. * sigmaDistanceSquared);
436 }
437
439
451 double likelihood(const vpColVector &coeffs, const std::vector<vpImagePoint> &meas)
452 {
453 double likelihood = 0.;
454 unsigned int nbPoints = static_cast<unsigned int>(meas.size());
455
456 // Generate a model from the coefficients stored in the particle state
457 vpTutoParabolaModel model(coeffs, m_height, m_width);
458
459 // Compute the residual between each measurement point and its equivalent in the model
460 vpColVector residuals(nbPoints);
461 for (unsigned int i = 0; i < nbPoints; ++i) {
462 double squareError = tutorial::evaluate(meas[i], model);
463 residuals[i] = squareError;
464 }
465
466 // Use Tukey M-estimator to be robust against outliers
467 vpRobust Mestimator;
468 vpColVector w(nbPoints, 1.);
469 Mestimator.MEstimator(vpRobust::TUKEY, residuals, w);
470 double sumError = w.hadamard(residuals).sum();
471
472 // Compute the likelihood as a Gaussian function
473 likelihood = std::exp(m_constantExpDenominator * sumError / w.sum()) * m_constantDenominator;
474 likelihood = std::min(likelihood, 1.0); // Clamp to have likelihood <= 1.
475 likelihood = std::max(likelihood, 0.); // Clamp to have likelihood >= 0.
476 return likelihood;
477 }
479private:
480 double m_constantDenominator;
481 double m_constantExpDenominator;
482 unsigned int m_height;
483 unsigned int m_width;
484};
486}
487#endif
488
489int main(const int argc, const char *argv[])
490{
491 tutorial::vpTutoCommonData data;
492 int returnCode = data.init(argc, argv);
493 if (returnCode != tutorial::vpTutoCommonData::SOFTWARE_CONTINUE) {
494 return returnCode;
495 }
496 const unsigned int vertOffset = static_cast<unsigned int>(data.m_legendOffset.get_i());
497 const unsigned int horOffset = static_cast<unsigned int>(data.m_ipLegend.get_j());
498 const unsigned int legendPFVert = data.m_I_orig.getHeight() - 2 * vertOffset, legendPFHor = horOffset;
499
500 // Initialize the attributes of the PF
502 vpColVector X0 = tutorial::computeInitialGuess(data);
504
506 const double maxDistanceForLikelihood = data.m_pfMaxDistanceForLikelihood; // The maximum allowed distance between a particle and the measurement, leading to a likelihood equal to 0..
507 const double sigmaLikelihood = maxDistanceForLikelihood / 3.; // The standard deviation of likelihood function.
508 const unsigned int nbParticles = data.m_pfN; // Number of particles to use
509 std::vector<double> stdevsPF; // Standard deviation for each state component
510 for (unsigned int i = 0; i < data.m_degree + 1; ++i) {
511 double ampliMax = data.m_pfRatiosAmpliMax[i] * X0[i];
512 stdevsPF.push_back(ampliMax / 3.);
513 }
514 unsigned long seedPF; // Seed for the random generators of the PF
515 const float period = 33.3f; // 33.3ms i.e. 30Hz
516 if (data.m_pfSeed < 0) {
517 seedPF = static_cast<unsigned long>(vpTime::measureTimeMicros());
518 }
519 else {
520 seedPF = data.m_pfSeed;
521 }
522 const int nbThread = data.m_pfNbThreads;
524
526 vpParticleFilter<std::vector<vpImagePoint>>::vpProcessFunction processFunc = tutorial::fx;
527 tutorial::vpTutoLikelihoodFunctor likelihoodFtor(sigmaLikelihood, data.m_I_orig.getHeight(), data.m_I_orig.getWidth());
528 using std::placeholders::_1;
529 using std::placeholders::_2;
530 vpParticleFilter<std::vector<vpImagePoint>>::vpLikelihoodFunction likelihoodFunc = std::bind(&tutorial::vpTutoLikelihoodFunctor::likelihood, &likelihoodFtor, _1, _2);
531 vpParticleFilter<std::vector<vpImagePoint>>::vpResamplingConditionFunction checkResamplingFunc = vpParticleFilter<std::vector<vpImagePoint>>::simpleResamplingCheck;
532 vpParticleFilter<std::vector<vpImagePoint>>::vpResamplingFunction resamplingFunc = vpParticleFilter<std::vector<vpImagePoint>>::simpleImportanceResampling;
533 tutorial::vpTutoAverageFunctor averageCpter(data.m_degree, data.m_I_orig.getHeight(), data.m_I_orig.getWidth());
534 using std::placeholders::_3;
535 vpParticleFilter<std::vector<vpImagePoint>>::vpFilterFunction meanFunc = std::bind(&tutorial::vpTutoAverageFunctor::averagePolynomials, &averageCpter, _1, _2, _3);
537
539 // Initialize the PF
540 vpParticleFilter<std::vector<vpImagePoint>> filter(nbParticles, stdevsPF, seedPF, nbThread);
541 filter.init(X0, processFunc, likelihoodFunc, checkResamplingFunc, resamplingFunc, meanFunc);
543
545#ifdef VISP_HAVE_DISPLAY
546 unsigned int plotHeight = 350, plotWidth = 350;
547 int plotXpos = static_cast<int>(data.m_legendOffset.get_u());
548 int plotYpos = static_cast<int>(data.m_I_orig.getHeight() + 4. * data.m_legendOffset.get_v());
549 vpPlot plot(1, plotHeight, plotWidth, plotXpos, plotYpos, "Root mean-square error");
550 plot.initGraph(0, 1);
551 plot.setLegend(0, 0, "PF estimator");
552 plot.setColor(0, 0, vpColor::red);
553#endif
555
556 bool run = true;
557 unsigned int nbIter = 0;
558 double meanDtPF = 0.;
559 double meanRootMeanSquareErrorPF = 0.;
560 while (!data.m_grabber.end() && run) {
561 std::cout << "Iter " << nbIter << std::endl;
562 data.m_grabber.acquire(data.m_I_orig);
563
564 tutorial::performSegmentationHSV(data);
565
567 std::vector<vpImagePoint> edgePoints = tutorial::extractSkeleton(data);
568
570 std::vector<vpImagePoint> noisyEdgePoints = tutorial::addSaltAndPepperNoise(edgePoints, data);
571
572#ifdef VISP_HAVE_DISPLAY
574 vpDisplay::display(data.m_I_orig);
575 vpDisplay::display(data.m_I_segmented);
576 vpDisplay::display(data.m_IskeletonNoisy);
577#endif
578
580 double tPF = vpTime::measureTimeMs();
582 filter.filter(noisyEdgePoints, period);
584 double dtPF = vpTime::measureTimeMs() - tPF;
585
587 vpColVector Xest = filter.computeFilteredState();
589
591 double pfError = tutorial::evaluate(Xest, data.m_I_orig.getHeight(), data.m_I_orig.getWidth(), edgePoints);
593 std::cout << " [Particle Filter method] " << std::endl;
594 std::cout << " Coeffs = [" << Xest.transpose() << " ]" << std::endl;
595 std::cout << " Root Mean Square Error = " << pfError << " pixels" << std::endl;
596 std::cout << " Fitting duration = " << dtPF << " ms" << std::endl;
597 meanDtPF += dtPF;
598 meanRootMeanSquareErrorPF += pfError;
599
600#ifdef VISP_HAVE_DISPLAY
601 // Update image overlay
602 tutorial::display(Xest, data.m_IskeletonNoisy, vpColor::red, legendPFVert, legendPFHor);
603
604 // Update plot
605 plot.plot(0, 0, nbIter, pfError);
606 // Display the images with overlayed info
607 data.displayLegend(data.m_I_orig);
608 vpDisplay::flush(data.m_I_orig);
609 vpDisplay::flush(data.m_I_segmented);
610 vpDisplay::flush(data.m_IskeletonNoisy);
611 run = data.manageClicks(data.m_I_orig, data.m_stepbystep);
612#endif
613 ++nbIter;
614 }
615
616 double iterAsDouble = static_cast<double>(nbIter);
617 std::cout << std::endl << std::endl << "-----[Statistics summary]-----" << std::endl;
618 std::cout << " [Particle Filter method] " << std::endl;
619 std::cout << " Average Root Mean Square Error = " << meanRootMeanSquareErrorPF / iterAsDouble << " pixels" << std::endl;
620 std::cout << " Average fitting duration = " << meanDtPF / iterAsDouble << " ms" << std::endl;
621
622#ifdef VISP_HAVE_DISPLAY
623 if (data.m_grabber.end() && (!data.m_stepbystep)) {
625 vpDisplay::display(data.m_I_orig);
626 vpDisplay::displayText(data.m_I_orig, data.m_ipLegend, "End of sequence reached. Click to exit.", data.m_colorLegend);
627
629 vpDisplay::flush(data.m_I_orig);
630
632 vpDisplay::getClick(data.m_I_orig, true);
633 }
634#endif
635 return 0;
636}
637#else
638int main()
639{
640 std::cerr << "ViSP must be compiled with C++ standard >= C++11 to use this tutorial." << std::endl;
641 std::cerr << "ViSP must also have a 3rd party enabling display features, such as X11 or OpenCV." << std::endl;
642 return EXIT_FAILURE;
643}
644#endif
Implementation of column vector and the associated operations.
static const vpColor red
Definition vpColor.h:198
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void flush(const vpImage< unsigned char > &I)
static void displayPoint(const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
double get_u() const
double get_v() const
unsigned int getWidth() const
Definition vpImage.h:242
unsigned int getHeight() const
Definition vpImage.h:181
static bool equal(double x, double y, double threshold=0.001)
Definition vpMath.h:470
The class permits to use a Particle Filter.
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
Definition vpPlot.h:117
@ TUKEY
Tukey influence function.
Definition vpRobust.h:89
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
Definition vpRobust.cpp:130
VISP_EXPORT double measureTimeMs()
VISP_EXPORT double measureTimeMicros()