ViSP  2.9.0
vpDot.cpp
1 /****************************************************************************
2  *
3  * $Id: vpDot.cpp 4649 2014-02-07 14:57:11Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Track a white dot.
36  *
37  * Authors:
38  * Eric Marchand
39  * Fabien Spindler
40  * Aurelien Yol
41  *
42  *****************************************************************************/
43 
44 /*
45  \file vpDot.cpp
46  \brief Track a white dot
47 */
48 
49 #include <visp/vpDot.h>
50 
51 #include <visp/vpDisplay.h>
52 #include <visp/vpColor.h>
53 
54 // exception handling
55 #include <visp/vpTrackingException.h>
56 #include <vector>
57 
58 #ifdef VISP_USE_MSVC
59 # pragma comment(linker, "/STACK:256000000") // Increase max recursion depth
60 #endif
61 
62 /*
63  \class vpDot
64  \brief Track a white dot
65 */
66 
67 /* spiral size for the dot search */
68 const unsigned int vpDot::SPIRAL_SEARCH_SIZE = 350;
69 
76 void vpDot::init()
77 {
78  cog.set_u(0);
79  cog.set_v(0);
80 
81  compute_moment = false ;
82  graphics = false ;
83  thickness = 1;
84  maxDotSizePercentage = 0.25 ; // 25 % of the image size
85 
86  mean_gray_level = 0;
87  gray_level_min = 128;
88  gray_level_max = 255;
89  grayLevelPrecision = 0.85;
90  gamma = 1.5 ;
91 
92  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu02 = mu20 = 0 ;
93 
94  connexityType = CONNEXITY_4;
95 
96  u_min = u_max = v_min = v_max = 0;
97 
98  gray_level_out = 0;
99  nbMaxPoint = 0;
100 }
101 
103  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
104  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
105  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
106  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
107  gamma(1.5), compute_moment(false), nbMaxPoint(0)
108 {
109 }
110 
117  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
118  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
119  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
120  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
121  gamma(1.5), compute_moment(false), nbMaxPoint(0)
122 {
123  cog = ip;
124 }
125 
130  : vpTracker(d),
131  m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
132  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
133  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
134  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
135  gamma(1.5), compute_moment(false), nbMaxPoint(0)
136 {
137  *this = d ;
138 }
139 
144 {
145  ip_connexities_list.clear() ;
146 }
147 
151 vpDot&
153 {
154  ip_edges_list = d.ip_edges_list;
155  ip_connexities_list = d.ip_connexities_list;
156  connexityType = d.connexityType;
157  cog = d.getCog();
158 
159  u_min = d.u_min;
160  v_min = d.v_min;
161  u_max = d.u_max;
162  v_max = d.v_max;
163 
164  graphics = d.graphics ;
165  thickness = d.thickness;
166  maxDotSizePercentage = d.maxDotSizePercentage;
167  gray_level_out = d.gray_level_out;
168  mean_gray_level = d.mean_gray_level ;
169  gray_level_min = d.gray_level_min ;
170  gray_level_max = d.gray_level_max ;
171  grayLevelPrecision = d.grayLevelPrecision;
172  gamma = d.gamma;
173  compute_moment = d.compute_moment ;
174  nbMaxPoint = d.nbMaxPoint;
175 
176  m00 = d.m00;
177  m01 = d.m01;
178  m10 = d.m10;
179  m11 = d.m11;
180  m02 = d.m02;
181  m20 = d.m20;
182 
183  mu11 = d.mu11;
184  mu20 = d.mu20;
185  mu02 = d.mu02;
186 
187  return *this ;
188 }
189 
190 bool
192 {
193  return ( cog != d.getCog() );
194 }
195 
196 bool
198 {
199  return ( cog == d.getCog() );
200 }
201 
213 void
214 vpDot::setGrayLevelOut()
215 {
216  if (gray_level_min == 0) {
217  if (gray_level_max == 255) {
218  // gray_level_min = 0 and gray_level_max = 255: this should not occur
219  vpERROR_TRACE("Unable to choose a good \"out\" level") ;
221  "Unable to choose a good \"out\" level")) ;
222  }
223  gray_level_out = static_cast<unsigned char>(gray_level_max + 1u);
224  }
225 }
226 
244 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
245  double &mean_value, double &u_cog, double &v_cog, double &n)
246 {
247  std::vector<bool> checkTab(I.getWidth()*I.getHeight(),false);
248  return connexe(I,u,v,mean_value,u_cog,v_cog,n,checkTab);
249 }
267 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
268  double &mean_value, double &u_cog, double &v_cog, double &n,std::vector<bool> &checkTab)
269 {
270 
271  unsigned int width = I.getWidth();
272  unsigned int height= I.getHeight();
273 
274  // Test if we are in the image
275  if ( (u >= width) || (v >= height) )
276  {
277  //std::cout << "out of bound" << std::endl;
278  return false;
279  }
280 
281  if(checkTab[u + v*I.getWidth()])
282  return true;
283 
284  vpImagePoint ip;
285  ip.set_u(u);
286  ip.set_v(v);
287 
288  if (I[v][u] >= gray_level_min && I[v][u] <= gray_level_max)
289  {
290  checkTab[v*I.getWidth() + u] = true;
291 
292  ip_connexities_list.push_back(ip);
293 
294  u_cog += u ;
295  v_cog += v ;
296  n+=1 ;
297 
298  if (n > nbMaxPoint) {
299  vpERROR_TRACE("Too many point %lf (%lf%% of image size). "
300  "This threshold can be modified using the setMaxDotSize() "
301  "method.",
302  n, n / (I.getWidth() * I.getHeight()),
303  nbMaxPoint, maxDotSizePercentage) ;
304 
306  "Dot to big")) ;
307  }
308 
309  // Bounding box update
310  if (u < this->u_min) this->u_min = u;
311  if (u > this->u_max) this->u_max = u;
312  if (v < this->v_min) this->v_min = v;
313  if (v > this->v_max) this->v_max = v;
314 
315  // Mean value of the dot intensities
316  mean_value = (mean_value *(n-1) + I[v][u]) / n;
317  if (compute_moment==true)
318  {
319  m00++ ;
320  m10 += u ;
321  m01 += v ;
322  m11 += (u*v) ;
323  m20 += u*u ;
324  m02 += v*v ;
325  }
326  }
327  else
328  {
329  //std::cout << "not in" << std::endl;
330  return false;
331  }
332 
333  bool edge = false;
334 
335  //if((int)u-1 >= 0)
336  if(u >= 1)
337  if(!checkTab[u-1 + v*I.getWidth()])
338  if(!connexe(I,u-1,v, mean_value,u_cog,v_cog, n, checkTab))
339  edge = true;
340 
341  if(u+1 < I.getWidth())
342  if(!checkTab[u+1+v*I.getWidth()])
343  if(!connexe(I,u+1,v,mean_value,u_cog, v_cog, n, checkTab))
344  edge = true;
345 
346  if(v >= 1)
347  if(!checkTab[u+(v-1)*I.getWidth()])
348  if(!connexe(I,u, v-1,mean_value,u_cog, v_cog, n, checkTab))
349  edge = true;
350 
351  if(v+1 < I.getHeight())
352  if(!checkTab[u+(v+1)*I.getWidth()])
353  if(!connexe(I,u,v+1,mean_value,u_cog, v_cog, n, checkTab))
354  edge = true;
355 
356  if (connexityType == CONNEXITY_8) {
357  if(v >= 1 && u >= 1)
358  if(!checkTab[u-1+(v-1)*I.getWidth()])
359  if(!connexe(I,u-1,v-1,mean_value,u_cog, v_cog, n, checkTab))
360  edge = true;
361 
362  if(v >= 1 && u+1 < I.getWidth())
363  if(!checkTab[u+1+(v-1)*I.getWidth()])
364  if(!connexe(I,u+1,v-1,mean_value,u_cog, v_cog, n, checkTab))
365  edge = true;
366 
367  if(v+1 < I.getHeight() && u >= 1)
368  if(!checkTab[u-1+(v+1)*I.getWidth()])
369  if(!connexe(I,u-1,v+1,mean_value, u_cog, v_cog, n, checkTab))
370  edge = true;
371 
372  if(v+1 < I.getHeight() && u+1 < I.getWidth())
373  if(!checkTab[u+1+(v+1)*I.getWidth()])
374  if(!connexe(I,u+1,v+1,mean_value,u_cog, v_cog, n, checkTab))
375  edge = true;
376  }
377 
378  if(edge){
379  ip_edges_list.push_back(ip);
380  if (graphics==true)
381  {
382  vpImagePoint ip_(ip);
383  for(unsigned int t=0; t<thickness; t++) {
384  ip_.set_u(ip.get_u() + t);
386  }
387  //vpDisplay::flush(I);
388  }
389  }
390 
391  return true;
392 }
393 
413 void
414 vpDot::COG(const vpImage<unsigned char> &I, double& u, double& v)
415 {
416  // Set the maximal number of points considering the maximal dot size
417  // image percentage
418  nbMaxPoint = (I.getWidth() * I.getHeight()) * maxDotSizePercentage;
419 
420  // segmentation de l'image apres seuillage
421  // (etiquetage des composante connexe)
422  if (compute_moment)
423  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu20 = mu02 = 0;
424 
425  double u_cog = 0 ;
426  double v_cog = 0 ;
427  double npoint = 0 ;
428  this->mean_gray_level = 0 ;
429 
430  ip_connexities_list.clear() ;
431  ip_edges_list.clear();
432 
433  // Initialise the boundig box
434  this->u_min = I.getWidth();
435  this->u_max = 0;
436  this->v_min = I.getHeight();
437  this->v_max = 0;
438 
439 #if 0
440  // Original version
441  if ( connexe(I, (unsigned int)u, (unsigned int)v,
442  gray_level_min, gray_level_max,
443  mean_gray_level, u_cog, v_cog, npoint) == vpDot::out)
444  {
445  bool sol = false ;
446  unsigned int pas ;
447  for (pas = 2 ; pas <= 25 ; pas ++ )if (sol==false)
448  {
449  for (int k=-1 ; k <=1 ; k++) if (sol==false)
450  for (int l=-1 ; l <=1 ; l++) if (sol==false)
451  {
452  u_cog = 0 ;
453  v_cog = 0 ;
454  ip_connexities_list.clear() ;
455 
456  this->mean_gray_level = 0 ;
457  if (connexe(I, (unsigned int)(u+k*pas),(unsigned int)(v+l*pas),
458  gray_level_min, gray_level_max,
459  mean_gray_level, u_cog, v_cog, npoint) != vpDot::out)
460  {
461  sol = true ; u += k*pas ; v += l*pas ;
462  }
463  }
464  }
465  if (sol == false)
466  {
467  vpERROR_TRACE("Dot has been lost") ;
469  "Dot has been lost")) ;
470  }
471  }
472 #else
473  // If the dot is not found, search around using a spiral
474  if ( !connexe(I,(unsigned int)u,(unsigned int)v, mean_gray_level, u_cog, v_cog, npoint) )
475  {
476  bool sol = false ;
477 
478  unsigned int right = 1;
479  unsigned int botom = 1;
480  unsigned int left = 2;
481  unsigned int up = 2;
482  double u_ = u, v_ = v;
483  unsigned int k;
484 
485  // Spiral search from the center to find the nearest dot
486  while( (right < SPIRAL_SEARCH_SIZE) && (sol == false) ) {
487  for (k=1; k <= right; k++) if(sol==false) {
488  u_cog = 0 ;
489  v_cog = 0 ;
490  ip_connexities_list.clear() ;
491  ip_edges_list.clear();
492 
493  this->mean_gray_level = 0 ;
494  if ( connexe(I, (unsigned int)u_+k, (unsigned int)(v_),mean_gray_level, u_cog, v_cog, npoint) ) {
495  sol = true; u = u_+k; v = v_;
496  }
497  }
498  u_ += k;
499  right += 2;
500 
501  for (k=1; k <= botom; k++) if (sol==false) {
502  u_cog = 0 ;
503  v_cog = 0 ;
504  ip_connexities_list.clear() ;
505  ip_edges_list.clear();
506 
507  this->mean_gray_level = 0 ;
508 
509  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_+k),mean_gray_level, u_cog, v_cog, npoint) ) {
510  sol = true; u = u_; v = v_+k;
511  }
512  }
513  v_ += k;
514  botom += 2;
515 
516  for (k=1; k <= left; k++) if (sol==false) {
517  u_cog = 0 ;
518  v_cog = 0 ;
519  ip_connexities_list.clear() ;
520  ip_edges_list.clear();
521 
522  this->mean_gray_level = 0 ;
523 
524  if ( connexe(I, (unsigned int)(u_-k), (unsigned int)(v_),mean_gray_level,u_cog, v_cog, npoint) ) {
525  sol = true ; u = u_-k; v = v_;
526  }
527  }
528  u_ -= k;
529  left += 2;
530 
531  for (k=1; k <= up; k++) if(sol==false) {
532  u_cog = 0 ;
533  v_cog = 0 ;
534  ip_connexities_list.clear() ;
535  ip_edges_list.clear();
536 
537  this->mean_gray_level = 0 ;
538 
539  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_-k),mean_gray_level,u_cog, v_cog, npoint) ) {
540  sol = true ; u = u_; v = v_-k;
541  }
542  }
543  v_ -= k;
544  up += 2;
545  }
546 
547  if (sol == false) {
548  vpERROR_TRACE("Dot has been lost") ;
550  "Dot has been lost")) ;
551  }
552  }
553 
554 #endif
555 /*
556  vpImagePoint ip;
557  unsigned int i, j;
558  std::list<vpImagePoint>::iterator it;
559  for (it = ip_connexities_list.begin(); it != ip_connexities_list.end(); it ++) {
560  ip = *it;
561  i = (unsigned int) ip.get_i();
562  j = (unsigned int) ip.get_j();
563  I[i][j] = 255 ;
564  }*/
565 
566  u_cog = u_cog/npoint ;
567  v_cog = v_cog/npoint ;
568 
569  u = u_cog ;
570  v = v_cog ;
571 
572  // Initialize the threshold for the next call to track()
573  double Ip = pow((double)this->mean_gray_level/255,1/gamma);
574 
575  if(Ip - (1 - grayLevelPrecision)<0){
576  gray_level_min = 0 ;
577  }
578  else{
579  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
580  if (gray_level_min > 255)
581  gray_level_min = 255;
582  }
583  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
584  if (gray_level_max > 255)
585  gray_level_max = 255;
586 
587  //vpCTRACE << "gray_level_min: " << gray_level_min << std::endl;
588  //vpCTRACE << "gray_level_max: " << gray_level_max << std::endl;
589 
590  if (npoint < 5)
591  {
592  vpERROR_TRACE("Dot to small") ;
594  "Dot to small")) ;
595  }
596 
597  if (npoint > nbMaxPoint)
598  {
599  vpERROR_TRACE("Too many point %lf (%lf%%). Max allowed is %lf (%lf%%). This threshold can be modified using the setMaxDotSize() method.",
600  npoint, npoint / (I.getWidth() * I.getHeight()),
601  nbMaxPoint, maxDotSizePercentage) ;
602 
604  "Dot to big")) ;
605  }
606 }
607 
620 void
621 vpDot::setMaxDotSize(double percentage)
622 {
623  if (percentage <= 0.0 || percentage > 1.0) {
624  // print a warning. We keep the default percentage
625  vpTRACE("Max dot size percentage is requested to be set to %lf.",
626  "Value should be in ]0:1]. Value will be set to %lf.",
627  percentage, maxDotSizePercentage);
628  }
629  else {
630  maxDotSizePercentage = percentage;
631  }
632 }
633 
657 void
659 {
660  while (vpDisplay::getClick(I, cog) != true) ;
661 
662  unsigned int i = (unsigned int)cog.get_i();
663  unsigned int j = (unsigned int)cog.get_j();
664 
665  double Ip = pow((double)I[i][j]/255, 1/gamma);
666 
667  if(Ip - (1 - grayLevelPrecision)<0){
668  gray_level_min = 0 ;
669  }
670  else{
671  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
672  if (gray_level_min > 255)
673  gray_level_min = 255;
674  }
675  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
676  if (gray_level_max > 255)
677  gray_level_max = 255;
678 
679  try {
680  track( I );
681  }
682  catch(...)
683  {
684  vpERROR_TRACE("Error caught") ;
685  throw ;
686  }
687 }
688 
712 void
714 {
715 
716  cog = ip ;
717 
718  unsigned int i = (unsigned int)cog.get_i();
719  unsigned int j = (unsigned int)cog.get_j();
720 
721  double Ip = pow((double)I[i][j]/255, 1/gamma);
722 
723  if(Ip - (1 - grayLevelPrecision)<0){
724  gray_level_min = 0 ;
725  }
726  else{
727  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
728  if (gray_level_min > 255)
729  gray_level_min = 255;
730  }
731  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
732  if (gray_level_max > 255)
733  gray_level_max = 255;
734  try {
735  track( I );
736  }
737  catch(...)
738  {
739  vpERROR_TRACE("Error caught") ;
740  throw ;
741  }
742 }
743 
771 void
773  unsigned int level_min, unsigned int level_max)
774 {
775 
776  cog = ip ;
777 
778  this->gray_level_min = level_min;
779  this->gray_level_max = level_max;
780 
781  try {
782  track( I );
783  }
784  catch(...)
785  {
786  vpERROR_TRACE("Error caught") ;
787  throw ;
788  }
789 }
790 
791 
806 void
808 {
809  try{
810  setGrayLevelOut();
811  double u = this->cog.get_u();
812  double v = this->cog.get_v();
813 
814  COG( I, u, v ) ;
815 
816  this->cog.set_u( u );
817  this->cog.set_v( v );
818 
819  if (compute_moment==true)
820  {
821  mu11 = m11 - u*m01;
822  mu02 = m02 - v*m01;
823  mu20 = m20 - u*m10;
824  }
825 
826  if (graphics) {
827  // display a red cross at the center of gravity's location in the image.
828  vpDisplay::displayCross(I, this->cog, 3*thickness+8, vpColor::red, thickness);
829  }
830 
831  }
832  catch(...)
833  {
834  vpERROR_TRACE("Error caught") ;
835  throw ;
836  }
837 }
838 
853 void
855 {
856  track( I ) ;
857 
858  ip = this->cog;
859 }
860 
868 void vpDot::display(const vpImage<unsigned char>& I, vpColor color, unsigned int thick) const
869 {
870  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thick);
871  std::list<vpImagePoint>::const_iterator it;
872 
873  for (it = ip_edges_list.begin(); it != ip_edges_list.end(); ++it)
874  {
875  vpDisplay::displayPoint(I, *it, color);
876  }
877 }
878 
896 void vpDot::setGrayLevelPrecision( const double & precision )
897 {
898  double epsilon = 0.05;
899  if( grayLevelPrecision<epsilon )
900  {
901  this->grayLevelPrecision = epsilon;
902  }
903  else if( grayLevelPrecision>1 )
904  {
905  this->grayLevelPrecision = 1.0;
906  }
907  else
908  {
909  this->grayLevelPrecision = precision;
910  }
911 }
912 
928  const std::list<vpImagePoint> &edges_list, vpColor color,
929  unsigned int thickness)
930 {
931  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
932  std::list<vpImagePoint>::const_iterator it;
933 
934  for (it = edges_list.begin(); it != edges_list.end(); ++it)
935  {
936  vpDisplay::displayPoint(I, *it, color);
937  }
938 }
939 
954 void vpDot::display(const vpImage<vpRGBa>& I,const vpImagePoint &cog,
955  const std::list<vpImagePoint> &edges_list, vpColor color,
956  unsigned int thickness)
957 {
958  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
959  std::list<vpImagePoint>::const_iterator it;
960 
961  for (it = edges_list.begin(); it != edges_list.end(); ++it)
962  {
963  vpDisplay::displayPoint(I, *it, color);
964  }
965 }
966 
972 VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpDot& d) {
973  return (os << "(" << d.getCog() << ")" ) ;
974 } ;
975 
976 
double get_v() const
Definition: vpImagePoint.h:263
double mu20
Definition: vpDot.h:182
bool operator!=(const vpDot &d)
Definition: vpDot.cpp:191
void setMaxDotSize(double percentage)
Definition: vpDot.cpp:621
double get_i() const
Definition: vpImagePoint.h:194
unsigned int getWidth() const
Definition: vpImage.h:159
void setGrayLevelPrecision(const double &grayLevelPrecision)
Definition: vpDot.cpp:896
double m10
Definition: vpDot.h:143
#define vpERROR_TRACE
Definition: vpDebug.h:395
#define vpTRACE
Definition: vpDebug.h:418
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
double get_u() const
Definition: vpImagePoint.h:252
void track(const vpImage< unsigned char > &I)
Definition: vpDot.cpp:807
double m00
Definition: vpDot.h:129
double mu11
Definition: vpDot.h:177
double mu02
Definition: vpDot.h:187
double get_j() const
Definition: vpImagePoint.h:205
static const unsigned int SPIRAL_SEARCH_SIZE
Definition: vpDot.h:127
double m20
Definition: vpDot.h:159
double m11
Definition: vpDot.h:150
static const vpColor red
Definition: vpColor.h:167
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:69
vpImagePoint getCog() const
Definition: vpDot.h:223
double m01
Definition: vpDot.h:136
Error that can be emited by the vpTracker class and its derivates.
vpDot & operator=(const vpDot &d)
Copy operator.
Definition: vpDot.cpp:152
void set_u(const double u)
Definition: vpImagePoint.h:216
void display(const vpImage< unsigned char > &I, vpColor color=vpColor::red, unsigned int thickness=1) const
Definition: vpDot.cpp:868
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
void set_v(const double v)
Definition: vpImagePoint.h:227
double m02
Definition: vpDot.h:168
vpDot()
Definition: vpDot.cpp:102
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage...
Definition: vpDot.h:114
unsigned int getHeight() const
Definition: vpImage.h:150
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:92
bool operator==(const vpDot &d)
Definition: vpDot.cpp:197
void initTracking(const vpImage< unsigned char > &I)
Definition: vpDot.cpp:658
virtual void displayPoint(const vpImagePoint &ip, const vpColor &color)=0
virtual ~vpDot()
Destructor.
Definition: vpDot.cpp:143