Visual Servoing Platform  version 3.1.0
vpMbtMeLine.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 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  * Make the complete tracking of an object by using its CAD model
33  *
34  * Authors:
35  * Nicolas Melchior
36  * Romain Tallonneau
37  * Eric Marchand
38  *
39  *****************************************************************************/
40 #include <visp3/core/vpConfig.h>
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 
47 #include <algorithm> // (std::min)
48 #include <cmath> // std::fabs
49 #include <limits> // numeric_limits
50 
51 #include <visp3/core/vpRobust.h>
52 #include <visp3/core/vpTrackingException.h>
53 #include <visp3/mbt/vpMbtMeLine.h>
54 
56 static void normalizeAngle(double &delta)
57 {
58  while (delta > M_PI) {
59  delta -= M_PI;
60  }
61  while (delta < -M_PI) {
62  delta += M_PI;
63  }
64 }
65 
69 vpMbtMeLine::vpMbtMeLine()
70  : rho(0.), theta(0.), theta_1(M_PI / 2), delta(0.), delta_1(0), sign(1), a(0.), b(0.), c(0.), imin(0), imax(0),
71  jmin(0), jmax(0), expecteddensity(0.)
72 {
73 }
74 
78 vpMbtMeLine::~vpMbtMeLine() { list.clear(); }
79 
94 void vpMbtMeLine::initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2,
95  double rho_, double theta_)
96 {
97  vpCDEBUG(1) << " begin vpMeLine::initTracking()" << std::endl;
98 
99  try {
100  // 1. On fait ce qui concerne les droites (peut etre vide)
101  // Points extremites
102  PExt[0].ifloat = (float)ip1.get_i();
103  PExt[0].jfloat = (float)ip1.get_j();
104  PExt[1].ifloat = (float)ip2.get_i();
105  PExt[1].jfloat = (float)ip2.get_j();
106 
107  this->rho = rho_;
108  this->theta = theta_;
109  theta_1 = theta_;
110 
111  a = cos(theta);
112  b = sin(theta);
113  c = -rho;
114 
115  delta = -theta + M_PI / 2.0;
116  normalizeAngle(delta);
117  delta_1 = delta;
118 
119  sample(I);
120  expecteddensity = (double)list.size();
121 
123  } catch (...) {
124  throw; // throw the original exception
125  }
126  vpCDEBUG(1) << " end vpMeLine::initTracking()" << std::endl;
127 }
128 
135 void vpMbtMeLine::sample(const vpImage<unsigned char> &I)
136 {
137  int rows = (int)I.getHeight();
138  int cols = (int)I.getWidth();
139  double n_sample;
140 
141  // if (me->getSampleStep==0)
142  if (std::fabs(me->getSampleStep()) <= std::numeric_limits<double>::epsilon()) {
143  throw(vpTrackingException(vpTrackingException::fatalError, "Function vpMbtMeLine::sample() called with "
144  "moving-edges sample step = 0"));
145  }
146 
147  // i, j portions of the line_p
148  double diffsi = PExt[0].ifloat - PExt[1].ifloat;
149  double diffsj = PExt[0].jfloat - PExt[1].jfloat;
150 
151  double length_p = sqrt((vpMath::sqr(diffsi) + vpMath::sqr(diffsj)));
152 
153  // number of samples along line_p
154  n_sample = length_p / (double)me->getSampleStep();
155 
156  double stepi = diffsi / (double)n_sample;
157  double stepj = diffsj / (double)n_sample;
158 
159  // Choose starting point
160  double is = PExt[1].ifloat;
161  double js = PExt[1].jfloat;
162 
163  // Delete old list
164  list.clear();
165 
166  // sample positions at i*me->getSampleStep() interval along the
167  // line_p, starting at PSiteExt[0]
168 
169  vpImagePoint ip;
170  for (int i = 0; i <= vpMath::round(n_sample); i++) {
171  // If point is in the image, add to the sample list
172  if (!outOfImage(vpMath::round(is), vpMath::round(js), (int)(me->getRange() + me->getMaskSize() + 1), (int)rows,
173  (int)cols)) {
174  vpMeSite pix; //= list.value();
175  pix.init((int)is, (int)js, delta, 0, sign);
176 
177  pix.track(I, me, false);
178 
179  pix.setDisplay(selectDisplay);
180 
181  if (vpDEBUG_ENABLE(3)) {
182  ip.set_i(is);
183  ip.set_j(js);
185  }
186 
187  list.push_back(pix);
188  }
189  is += stepi;
190  js += stepj;
191  }
192 
193  vpCDEBUG(1) << "end vpMeLine::sample() : ";
194  vpCDEBUG(1) << list.size() << " point inserted in the list " << std::endl;
195 }
196 
202 void vpMbtMeLine::suppressPoints(const vpImage<unsigned char> &I)
203 {
204  for (std::list<vpMeSite>::iterator it = list.begin(); it != list.end();) {
205  vpMeSite s = *it; // current reference pixel
206 
207  if (fabs(sin(theta)) > 0.9) // Vertical line management
208  {
209  if ((s.i < imin) || (s.i > imax)) {
211  }
212  }
213 
214  else if (fabs(cos(theta)) > 0.9) // Horizontal line management
215  {
216  if ((s.j < jmin) || (s.j > jmax)) {
218  }
219  }
220 
221  else {
222  if ((s.i < imin) || (s.i > imax) || (s.j < jmin) || (s.j > jmax)) {
224  }
225  }
226 
227  if (outOfImage(s.i, s.j, (int)(me->getRange() + me->getMaskSize() + 1), (int)I.getHeight(), (int)I.getWidth())) {
229  }
230 
232  it = list.erase(it);
233  else
234  ++it;
235  }
236 }
237 
244 void vpMbtMeLine::seekExtremities(const vpImage<unsigned char> &I)
245 {
246  vpCDEBUG(1) << "begin vpMeLine::sample() : " << std::endl;
247 
248  int rows = (int)I.getHeight();
249  int cols = (int)I.getWidth();
250  double n_sample;
251 
252  // if (me->getSampleStep()==0)
253  if (std::fabs(me->getSampleStep()) <= std::numeric_limits<double>::epsilon()) {
254  throw(vpTrackingException(vpTrackingException::fatalError, "Function called with sample step = 0"));
255  }
256 
257  // i, j portions of the line_p
258  double diffsi = PExt[0].ifloat - PExt[1].ifloat;
259  double diffsj = PExt[0].jfloat - PExt[1].jfloat;
260 
261  double s = vpMath::sqr(diffsi) + vpMath::sqr(diffsj);
262 
263  double di = diffsi / sqrt(s); // pas de risque de /0 car d(P1,P2) >0
264  double dj = diffsj / sqrt(s);
265 
266  double length_p = sqrt(s); /*(vpMath::sqr(diffsi)+vpMath::sqr(diffsj))*/
267 
268  // number of samples along line_p
269  n_sample = length_p / (double)me->getSampleStep();
270  double sample_step = (double)me->getSampleStep();
271 
272  vpMeSite P;
273  P.init((int)PExt[0].ifloat, (int)PExt[0].jfloat, delta_1, 0, sign);
274  P.setDisplay(selectDisplay);
275 
276  unsigned int memory_range = me->getRange();
277  me->setRange(1);
278 
279  for (int i = 0; i < 3; i++) {
280  P.ifloat = P.ifloat + di * sample_step;
281  P.i = (int)P.ifloat;
282  P.jfloat = P.jfloat + dj * sample_step;
283  P.j = (int)P.jfloat;
284 
285  if ((P.i < imin) || (P.i > imax) || (P.j < jmin) || (P.j > jmax)) {
286  if (vpDEBUG_ENABLE(3))
288  } else if (!outOfImage(P.i, P.j, (int)(me->getRange() + me->getMaskSize() + 1), (int)rows, (int)cols)) {
289  P.track(I, me, false);
290 
291  if (P.getState() == vpMeSite::NO_SUPPRESSION) {
292  list.push_back(P);
293  if (vpDEBUG_ENABLE(3))
295  } else if (vpDEBUG_ENABLE(3))
297  }
298  }
299 
300  P.init((int)PExt[1].ifloat, (int)PExt[1].jfloat, delta_1, 0, sign);
301  P.setDisplay(selectDisplay);
302  for (int i = 0; i < 3; i++) {
303  P.ifloat = P.ifloat - di * sample_step;
304  P.i = (int)P.ifloat;
305  P.jfloat = P.jfloat - dj * sample_step;
306  P.j = (int)P.jfloat;
307 
308  if ((P.i < imin) || (P.i > imax) || (P.j < jmin) || (P.j > jmax)) {
309  if (vpDEBUG_ENABLE(3))
311  }
312 
313  else if (!outOfImage(P.i, P.j, (int)(me->getRange() + me->getMaskSize() + 1), (int)rows, (int)cols)) {
314  P.track(I, me, false);
315 
316  if (P.getState() == vpMeSite::NO_SUPPRESSION) {
317  list.push_back(P);
318  if (vpDEBUG_ENABLE(3))
320  } else if (vpDEBUG_ENABLE(3))
322  }
323  }
324 
325  me->setRange(memory_range);
326 
327  vpCDEBUG(1) << "end vpMeLine::sample() : ";
328  vpCDEBUG(1) << n_sample << " point inserted in the list " << std::endl;
329 }
330 
340 void vpMbtMeLine::computeProjectionError(const vpImage<unsigned char> &_I, double &_sumErrorRad,
341  unsigned int &_nbFeatures)
342 {
343  _sumErrorRad = 0;
344  _nbFeatures = 0;
345  double deltaNormalized = theta;
346  unsigned int iter = 0;
347 
348  while (deltaNormalized < 0)
349  deltaNormalized += M_PI;
350  while (deltaNormalized > M_PI)
351  deltaNormalized -= M_PI;
352 
353  vpColVector vecLine(2);
354  vecLine[0] = cos(deltaNormalized);
355  vecLine[1] = sin(deltaNormalized);
356  vecLine.normalize();
357 
358  // vpMatrix filterX(3,3);
359  // filterX[0][0] = -1;
360  // filterX[1][0] = -2;
361  // filterX[2][0] = -1;
362 
363  // filterX[0][1] = 0;
364  // filterX[1][1] = 0;
365  // filterX[2][1] = 0;
366 
367  // filterX[0][2] = 1;
368  // filterX[1][2] = 2;
369  // filterX[2][2] = 1;
370 
371  // vpMatrix filterY(3,3);
372  // filterY[0][0] = -1;
373  // filterY[0][1] = -2;
374  // filterY[0][2] = -1;
375 
376  // filterY[1][0] = 0;
377  // filterY[1][1] = 0;
378  // filterY[1][2] = 0;
379 
380  // filterY[2][0] = 1;
381  // filterY[2][1] = 2;
382  // filterY[2][2] = 1;
383 
384  vpMatrix filterX(5, 5);
385  filterX[0][0] = -1;
386  filterX[1][0] = -4;
387  filterX[2][0] = -6;
388  filterX[3][0] = -4;
389  filterX[4][0] = -1;
390 
391  filterX[0][1] = -2;
392  filterX[1][1] = -8;
393  filterX[2][1] = -12;
394  filterX[3][1] = -8;
395  filterX[4][1] = -2;
396 
397  filterX[0][2] = 0;
398  filterX[1][2] = 0;
399  filterX[2][2] = 0;
400  filterX[3][2] = 0;
401  filterX[4][2] = 0;
402 
403  filterX[0][3] = 2;
404  filterX[1][3] = 8;
405  filterX[2][3] = 12;
406  filterX[3][3] = 8;
407  filterX[4][3] = 2;
408 
409  filterX[0][4] = 1;
410  filterX[1][4] = 4;
411  filterX[2][4] = 6;
412  filterX[3][4] = 4;
413  filterX[4][4] = 1;
414 
415  vpMatrix filterY(5, 5);
416  filterY[0][0] = -1;
417  filterY[0][1] = -4;
418  filterY[0][2] = -6;
419  filterY[0][3] = -4;
420  filterY[0][4] = -1;
421 
422  filterY[1][0] = -2;
423  filterY[1][1] = -8;
424  filterY[1][2] = -12;
425  filterY[1][3] = -8;
426  filterY[1][4] = -2;
427 
428  filterY[2][0] = 0;
429  filterY[2][1] = 0;
430  filterY[2][2] = 0;
431  filterY[2][3] = 0;
432  filterY[2][4] = 0;
433 
434  filterY[3][0] = 2;
435  filterY[3][1] = 8;
436  filterY[3][2] = 12;
437  filterY[3][3] = 8;
438  filterY[3][4] = 2;
439 
440  filterY[4][0] = 1;
441  filterY[4][1] = 4;
442  filterY[4][2] = 6;
443  filterY[4][3] = 4;
444  filterY[4][4] = 1;
445 
446  double offset = std::floor(filterX.getRows() / 2.0f);
447 
448  for (std::list<vpMeSite>::iterator it = list.begin(); it != list.end(); ++it) {
449  if (iter != 0 && iter + 1 != list.size()) {
450  double gradientX = 0;
451  double gradientY = 0;
452 
453  double iSite = it->ifloat;
454  double jSite = it->jfloat;
455 
456  for (unsigned int i = 0; i < filterX.getRows(); i++) {
457  double iImg = iSite + (i - offset);
458  for (unsigned int j = 0; j < filterX.getCols(); j++) {
459  double jImg = jSite + (j - offset);
460 
461  if (iImg < 0)
462  iImg = 0.0;
463  if (jImg < 0)
464  jImg = 0.0;
465 
466  if (iImg > _I.getHeight() - 1)
467  iImg = _I.getHeight() - 1;
468  if (jImg > _I.getWidth() - 1)
469  jImg = _I.getWidth() - 1;
470 
471  gradientX += filterX[i][j] * _I((unsigned int)iImg, (unsigned int)jImg);
472  }
473  }
474 
475  for (unsigned int i = 0; i < filterY.getRows(); i++) {
476  double iImg = iSite + (i - offset);
477  for (unsigned int j = 0; j < filterY.getCols(); j++) {
478  double jImg = jSite + (j - offset);
479 
480  if (iImg < 0)
481  iImg = 0.0;
482  if (jImg < 0)
483  jImg = 0.0;
484 
485  if (iImg > _I.getHeight() - 1)
486  iImg = _I.getHeight() - 1;
487  if (jImg > _I.getWidth() - 1)
488  jImg = _I.getWidth() - 1;
489 
490  gradientY += filterY[i][j] * _I((unsigned int)iImg, (unsigned int)jImg);
491  }
492  }
493 
494  double angle = atan2(gradientX, gradientY);
495  while (angle < 0)
496  angle += M_PI;
497  while (angle > M_PI)
498  angle -= M_PI;
499 
500  vpColVector vecGrad(2);
501  vecGrad[0] = cos(angle);
502  vecGrad[1] = sin(angle);
503  vecGrad.normalize();
504 
505  double angle1 = acos(vecLine * vecGrad);
506  double angle2 = acos(vecLine * (-vecGrad));
507 
508  // double angle1 = sqrt(vpMath::sqr(deltaNormalized-angle));
509  // double angle2 = sqrt(vpMath::sqr(deltaNormalized-
510  // (angle-M_PI)));
511 
512  _sumErrorRad += (std::min)(angle1, angle2);
513 
514  // if(std::fabs(deltaNormalized-angle) > M_PI / 2)
515  // {
516  // sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle)) - M_PI
517  // / 2;
518  // } else {
519  // sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle));
520  // }
521 
522  _nbFeatures++;
523  }
524  iter++;
525  }
526 }
527 
538 void vpMbtMeLine::reSample(const vpImage<unsigned char> &I)
539 {
540  unsigned int n = numberOfSignal();
541 
542  if ((double)n < 0.5 * expecteddensity && n > 0) {
543  double delta_new = delta;
544  delta = delta_1;
545  sample(I);
546  expecteddensity = (double)list.size();
547  delta = delta_new;
548  // 2. On appelle ce qui n'est pas specifique
549  {
551  }
552  }
553 }
554 
567 void vpMbtMeLine::reSample(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2)
568 {
569  size_t n = list.size();
570 
571  if ((double)n < 0.5 * expecteddensity /*&& n > 0*/) // n is always > 0
572  {
573  double delta_new = delta;
574  delta = delta_1;
575  PExt[0].ifloat = (float)ip1.get_i();
576  PExt[0].jfloat = (float)ip1.get_j();
577  PExt[1].ifloat = (float)ip2.get_i();
578  PExt[1].jfloat = (float)ip2.get_j();
579  sample(I);
580  expecteddensity = (double)list.size();
581  delta = delta_new;
583  }
584 }
585 
589 void vpMbtMeLine::updateDelta()
590 {
591  vpMeSite p_me;
592 
593  double diff = 0;
594 
595  // if(fabs(theta) == M_PI )
596  if (std::fabs(std::fabs(theta) - M_PI) <=
597  vpMath::maximum(std::fabs(theta), (double)M_PI) * std::numeric_limits<double>::epsilon()) {
598  theta = 0;
599  }
600 
601  diff = fabs(theta - theta_1);
602  if (diff > M_PI / 2.0)
603  sign *= -1;
604 
605  theta_1 = theta;
606 
607  delta = -theta + M_PI / 2.0;
608  normalizeAngle(delta);
609 
610  for (std::list<vpMeSite>::iterator it = list.begin(); it != list.end(); ++it) {
611  p_me = *it;
612  p_me.alpha = delta;
613  p_me.mask_sign = sign;
614  *it = p_me;
615  }
616  delta_1 = delta;
617 }
618 
624 void vpMbtMeLine::track(const vpImage<unsigned char> &I)
625 {
626  // 2. On appelle ce qui n'est pas specifique
627  try {
629  } catch (...) {
630  throw; // throw the original exception
631  }
632 
633  // supression des points rejetes par les ME
634  // suppressPoints(I);
635  // setExtremities();
636 }
637 
646 void vpMbtMeLine::updateParameters(const vpImage<unsigned char> &I, double rho_, double theta_)
647 {
648  this->rho = rho_;
649  this->theta = theta_;
650  a = cos(theta);
651  b = sin(theta);
652  c = -rho;
653  // recherche de point aux extremite de la droites
654  // dans le cas d'un glissement
655  suppressPoints(I);
656  seekExtremities(I);
657  suppressPoints(I);
658  setExtremities();
659  // reechantillonage si necessaire
660  reSample(I);
661 
662  // remet a jour l'angle delta pour chaque point de la liste
663  updateDelta();
664 }
665 
676 void vpMbtMeLine::updateParameters(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2,
677  double rho_, double theta_)
678 {
679  this->rho = rho_;
680  this->theta = theta_;
681  a = cos(theta);
682  b = sin(theta);
683  c = -rho;
684  // recherche de point aux extremite de la droites
685  // dans le cas d'un glissement
686  suppressPoints(I);
687  seekExtremities(I);
688  suppressPoints(I);
689  setExtremities();
690  // reechantillonage si necessaire
691  reSample(I, ip1, ip2);
692 
693  // remet a jour l'angle delta pour chaque point de la liste
694  updateDelta();
695 }
696 
700 void vpMbtMeLine::setExtremities()
701 {
702  double i_min = +1e6;
703  double j_min = +1e6;
704  double i_max = -1;
705  double j_max = -1;
706 
707  // Loop through list of sites to track
708  for (std::list<vpMeSite>::const_iterator it = list.begin(); it != list.end(); ++it) {
709  vpMeSite s = *it; // current reference pixel
710  if (s.ifloat < i_min) {
711  i_min = s.ifloat;
712  j_min = s.jfloat;
713  }
714 
715  if (s.ifloat > i_max) {
716  i_max = s.ifloat;
717  j_max = s.jfloat;
718  }
719  }
720 
721  if (!list.empty()) {
722  PExt[0].ifloat = i_min;
723  PExt[0].jfloat = j_min;
724  PExt[1].ifloat = i_max;
725  PExt[1].jfloat = j_max;
726  }
727 
728  if (fabs(i_min - i_max) < 25) {
729  for (std::list<vpMeSite>::const_iterator it = list.begin(); it != list.end(); ++it) {
730  vpMeSite s = *it; // current reference pixel
731  if (s.jfloat < j_min) {
732  i_min = s.ifloat;
733  j_min = s.jfloat;
734  }
735 
736  if (s.jfloat > j_max) {
737  i_max = s.ifloat;
738  j_max = s.jfloat;
739  }
740  }
741 
742  if (!list.empty()) {
743  PExt[0].ifloat = i_min;
744  PExt[0].jfloat = j_min;
745  PExt[1].ifloat = i_max;
746  PExt[1].jfloat = j_max;
747  }
748  bubbleSortJ();
749  }
750 
751  else
752  bubbleSortI();
753 }
754 
755 static bool sortByI(const vpMeSite &s1, const vpMeSite &s2) { return (s1.ifloat > s2.ifloat); }
756 
757 void vpMbtMeLine::bubbleSortI()
758 {
759 #if 0
760  unsigned int nbElmt = list.size();
761  for (unsigned int pass = 1; pass < nbElmt; pass++)
762  {
763  list.front();
764  for (unsigned int i=0; i < nbElmt-pass; i++)
765  {
766  vpMeSite s1 = list.value();
767  vpMeSite s2 = list.nextValue();
768  if (s1.ifloat > s2.ifloat)
769  list.swapRight();
770  else
771  list.next();
772  }
773  }
774 #endif
775  list.sort(sortByI);
776 }
777 
778 static bool sortByJ(const vpMeSite &s1, const vpMeSite &s2) { return (s1.jfloat > s2.jfloat); }
779 
780 void vpMbtMeLine::bubbleSortJ()
781 {
782 #if 0
783  unsigned int nbElmt = list.size();
784  for(unsigned int pass=1; pass < nbElmt; pass++)
785  {
786  list.front();
787  for (unsigned int i=0; i < nbElmt-pass; i++)
788  {
789  vpMeSite s1 = list.value();
790  vpMeSite s2 = list.nextValue();
791  if (s1.jfloat > s2.jfloat)
792  list.swapRight();
793  else
794  list.next();
795  }
796  }
797 #endif
798  list.sort(sortByJ);
799 }
800 
801 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
double get_i() const
Definition: vpImagePoint.h:204
vpMeSiteState getState() const
Definition: vpMeSite.h:188
void init()
Definition: vpMeSite.cpp:66
double jfloat
Definition: vpMeSite.h:88
#define vpDEBUG_ENABLE(level)
Definition: vpDebug.h:538
Performs search in a given direction(normal) for a given distance(pixels) for a given &#39;site&#39;...
Definition: vpMeSite.h:71
double alpha
Definition: vpMeSite.h:92
int i
Definition: vpMeSite.h:86
int mask_sign
Definition: vpMeSite.h:90
static const vpColor green
Definition: vpColor.h:183
static int round(const double x)
Definition: vpMath.h:235
unsigned int getMaskSize() const
Definition: vpMe.h:142
static Type maximum(const Type &a, const Type &b)
Definition: vpMath.h:137
double ifloat
Definition: vpMeSite.h:88
void set_i(const double ii)
Definition: vpImagePoint.h:167
Error that can be emited by the vpTracker class and its derivates.
static const vpColor cyan
Definition: vpColor.h:189
double getSampleStep() const
Definition: vpMe.h:285
static double sqr(double x)
Definition: vpMath.h:108
double get_j() const
Definition: vpImagePoint.h:215
void setDisplay(vpMeSiteDisplayType select)
Definition: vpMeSite.h:137
#define vpCDEBUG(level)
Definition: vpDebug.h:511
void track(const vpImage< unsigned char > &I)
Track sampled pixels.
void setState(const vpMeSiteState &flag)
Definition: vpMeSite.h:174
void set_j(const double jj)
Definition: vpImagePoint.h:178
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
int j
Definition: vpMeSite.h:86
unsigned int getHeight() const
Definition: vpImage.h:178
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
void track(const vpImage< unsigned char > &im, const vpMe *me, const bool test_contraste=true)
Definition: vpMeSite.cpp:362
void initTracking(const vpImage< unsigned char > &I)
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
unsigned int getWidth() const
Definition: vpImage.h:229
unsigned int getRange() const
Definition: vpMe.h:179
static const vpColor blue
Definition: vpColor.h:186