ViSP  2.10.0
vpDot.cpp
1 /****************************************************************************
2  *
3  * $Id: vpDot.cpp 4943 2014-11-03 13:51:09Z 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 #include <visp/vpDisplay.h>
51 #include <visp/vpColor.h>
52 #include <visp/vpTrackingException.h>
53 
54 #include <vector>
55 
56 /*
57  \class vpDot
58  \brief Track a white dot
59 */
60 
61 /* spiral size for the dot search */
62 const unsigned int vpDot::SPIRAL_SEARCH_SIZE = 350;
63 
70 void vpDot::init()
71 {
72  cog.set_u(0);
73  cog.set_v(0);
74 
75  compute_moment = false ;
76  graphics = false ;
77  thickness = 1;
78  maxDotSizePercentage = 0.25 ; // 25 % of the image size
79 
80  mean_gray_level = 0;
81  gray_level_min = 128;
82  gray_level_max = 255;
83  grayLevelPrecision = 0.85;
84  gamma = 1.5 ;
85 
86  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu02 = mu20 = 0 ;
87 
88  connexityType = CONNEXITY_4;
89 
90  u_min = u_max = v_min = v_max = 0;
91 
92  gray_level_out = 0;
93  nbMaxPoint = 0;
94 }
95 
97  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
98  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
99  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
100  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
101  gamma(1.5), compute_moment(false), nbMaxPoint(0)
102 {
103 }
104 
111  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
112  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
113  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
114  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
115  gamma(1.5), compute_moment(false), nbMaxPoint(0)
116 {
117  cog = ip;
118 }
119 
124  : vpTracker(d),
125  m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
126  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
127  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
128  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
129  gamma(1.5), compute_moment(false), nbMaxPoint(0)
130 {
131  *this = d ;
132 }
133 
138 {
139  ip_connexities_list.clear() ;
140 }
141 
145 vpDot&
147 {
148  ip_edges_list = d.ip_edges_list;
149  ip_connexities_list = d.ip_connexities_list;
150  connexityType = d.connexityType;
151  cog = d.getCog();
152 
153  u_min = d.u_min;
154  v_min = d.v_min;
155  u_max = d.u_max;
156  v_max = d.v_max;
157 
158  graphics = d.graphics ;
159  thickness = d.thickness;
160  maxDotSizePercentage = d.maxDotSizePercentage;
161  gray_level_out = d.gray_level_out;
162  mean_gray_level = d.mean_gray_level ;
163  gray_level_min = d.gray_level_min ;
164  gray_level_max = d.gray_level_max ;
165  grayLevelPrecision = d.grayLevelPrecision;
166  gamma = d.gamma;
167  compute_moment = d.compute_moment ;
168  nbMaxPoint = d.nbMaxPoint;
169 
170  m00 = d.m00;
171  m01 = d.m01;
172  m10 = d.m10;
173  m11 = d.m11;
174  m02 = d.m02;
175  m20 = d.m20;
176 
177  mu11 = d.mu11;
178  mu20 = d.mu20;
179  mu02 = d.mu02;
180 
181  return *this ;
182 }
183 
184 bool
186 {
187  return ( cog != d.getCog() );
188 }
189 
190 bool
192 {
193  return ( cog == d.getCog() );
194 }
195 
207 void
208 vpDot::setGrayLevelOut()
209 {
210  if (gray_level_min == 0) {
211  if (gray_level_max == 255) {
212  // gray_level_min = 0 and gray_level_max = 255: this should not occur
213  //vpERROR_TRACE("Unable to choose a good \"out\" level") ;
215  "Unable to choose a good \"out\" level")) ;
216  }
217  gray_level_out = static_cast<unsigned char>(gray_level_max + 1u);
218  }
219 }
220 
238 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
239  double &mean_value, double &u_cog, double &v_cog, double &n)
240 {
241  std::vector<bool> checkTab(I.getWidth()*I.getHeight(),false);
242  return connexe(I,u,v,mean_value,u_cog,v_cog,n,checkTab);
243 }
261 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
262  double &mean_value, double &u_cog, double &v_cog, double &n,std::vector<bool> &checkTab)
263 {
264 
265  unsigned int width = I.getWidth();
266  unsigned int height= I.getHeight();
267 
268  // Test if we are in the image
269  if ( (u >= width) || (v >= height) )
270  {
271  //std::cout << "out of bound" << std::endl;
272  return false;
273  }
274 
275  if(checkTab[u + v*I.getWidth()])
276  return true;
277 
278  vpImagePoint ip;
279  ip.set_u(u);
280  ip.set_v(v);
281 
282  if (I[v][u] >= gray_level_min && I[v][u] <= gray_level_max)
283  {
284  checkTab[v*I.getWidth() + u] = true;
285 
286  ip_connexities_list.push_back(ip);
287 
288  u_cog += u ;
289  v_cog += v ;
290  n+=1 ;
291 
292  if (n > nbMaxPoint) {
293 // vpERROR_TRACE("Too many point %lf (%lf%% of image size). "
294 // "This threshold can be modified using the setMaxDotSize() "
295 // "method.",
296 // n, n / (I.getWidth() * I.getHeight()),
297 // nbMaxPoint, maxDotSizePercentage) ;
298 
300  "Too many point %lf (%lf%% of image size). "
301  "This threshold can be modified using the setMaxDotSize() "
302  "method.",
303  n, n / (I.getWidth() * I.getHeight()),
304  nbMaxPoint, maxDotSizePercentage)) ;
305  }
306 
307  // Bounding box update
308  if (u < this->u_min) this->u_min = u;
309  if (u > this->u_max) this->u_max = u;
310  if (v < this->v_min) this->v_min = v;
311  if (v > this->v_max) this->v_max = v;
312 
313  // Mean value of the dot intensities
314  mean_value = (mean_value *(n-1) + I[v][u]) / n;
315  if (compute_moment==true)
316  {
317  m00++ ;
318  m10 += u ;
319  m01 += v ;
320  m11 += (u*v) ;
321  m20 += u*u ;
322  m02 += v*v ;
323  }
324  }
325  else
326  {
327  //std::cout << "not in" << std::endl;
328  return false;
329  }
330 
331  bool edge = false;
332 
333  //if((int)u-1 >= 0)
334  if(u >= 1)
335  if(!checkTab[u-1 + v*I.getWidth()])
336  if(!connexe(I,u-1,v, mean_value,u_cog,v_cog, n, checkTab))
337  edge = true;
338 
339  if(u+1 < I.getWidth())
340  if(!checkTab[u+1+v*I.getWidth()])
341  if(!connexe(I,u+1,v,mean_value,u_cog, v_cog, n, checkTab))
342  edge = true;
343 
344  if(v >= 1)
345  if(!checkTab[u+(v-1)*I.getWidth()])
346  if(!connexe(I,u, v-1,mean_value,u_cog, v_cog, n, checkTab))
347  edge = true;
348 
349  if(v+1 < I.getHeight())
350  if(!checkTab[u+(v+1)*I.getWidth()])
351  if(!connexe(I,u,v+1,mean_value,u_cog, v_cog, n, checkTab))
352  edge = true;
353 
354  if (connexityType == CONNEXITY_8) {
355  if(v >= 1 && u >= 1)
356  if(!checkTab[u-1+(v-1)*I.getWidth()])
357  if(!connexe(I,u-1,v-1,mean_value,u_cog, v_cog, n, checkTab))
358  edge = true;
359 
360  if(v >= 1 && u+1 < I.getWidth())
361  if(!checkTab[u+1+(v-1)*I.getWidth()])
362  if(!connexe(I,u+1,v-1,mean_value,u_cog, v_cog, n, checkTab))
363  edge = true;
364 
365  if(v+1 < I.getHeight() && u >= 1)
366  if(!checkTab[u-1+(v+1)*I.getWidth()])
367  if(!connexe(I,u-1,v+1,mean_value, u_cog, v_cog, n, checkTab))
368  edge = true;
369 
370  if(v+1 < I.getHeight() && u+1 < I.getWidth())
371  if(!checkTab[u+1+(v+1)*I.getWidth()])
372  if(!connexe(I,u+1,v+1,mean_value,u_cog, v_cog, n, checkTab))
373  edge = true;
374  }
375 
376  if(edge){
377  ip_edges_list.push_back(ip);
378  if (graphics==true)
379  {
380  vpImagePoint ip_(ip);
381  for(unsigned int t=0; t<thickness; t++) {
382  ip_.set_u(ip.get_u() + t);
384  }
385  //vpDisplay::flush(I);
386  }
387  }
388 
389  return true;
390 }
391 
411 void
412 vpDot::COG(const vpImage<unsigned char> &I, double& u, double& v)
413 {
414  // Set the maximal number of points considering the maximal dot size
415  // image percentage
416  nbMaxPoint = (I.getWidth() * I.getHeight()) * maxDotSizePercentage;
417 
418  // segmentation de l'image apres seuillage
419  // (etiquetage des composante connexe)
420  if (compute_moment)
421  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu20 = mu02 = 0;
422 
423  double u_cog = 0 ;
424  double v_cog = 0 ;
425  double npoint = 0 ;
426  this->mean_gray_level = 0 ;
427 
428  ip_connexities_list.clear() ;
429  ip_edges_list.clear();
430 
431  // Initialise the boundig box
432  this->u_min = I.getWidth();
433  this->u_max = 0;
434  this->v_min = I.getHeight();
435  this->v_max = 0;
436 
437 #if 0
438  // Original version
439  if ( connexe(I, (unsigned int)u, (unsigned int)v,
440  gray_level_min, gray_level_max,
441  mean_gray_level, u_cog, v_cog, npoint) == vpDot::out)
442  {
443  bool sol = false ;
444  unsigned int pas ;
445  for (pas = 2 ; pas <= 25 ; pas ++ )if (sol==false)
446  {
447  for (int k=-1 ; k <=1 ; k++) if (sol==false)
448  for (int l=-1 ; l <=1 ; l++) if (sol==false)
449  {
450  u_cog = 0 ;
451  v_cog = 0 ;
452  ip_connexities_list.clear() ;
453 
454  this->mean_gray_level = 0 ;
455  if (connexe(I, (unsigned int)(u+k*pas),(unsigned int)(v+l*pas),
456  gray_level_min, gray_level_max,
457  mean_gray_level, u_cog, v_cog, npoint) != vpDot::out)
458  {
459  sol = true ; u += k*pas ; v += l*pas ;
460  }
461  }
462  }
463  if (sol == false)
464  {
465  //vpERROR_TRACE("Dot has been lost") ;
467  "Dot has been lost")) ;
468  }
469  }
470 #else
471  // If the dot is not found, search around using a spiral
472  if ( !connexe(I,(unsigned int)u,(unsigned int)v, mean_gray_level, u_cog, v_cog, npoint) )
473  {
474  bool sol = false ;
475 
476  unsigned int right = 1;
477  unsigned int botom = 1;
478  unsigned int left = 2;
479  unsigned int up = 2;
480  double u_ = u, v_ = v;
481  unsigned int k;
482 
483  // Spiral search from the center to find the nearest dot
484  while( (right < SPIRAL_SEARCH_SIZE) && (sol == false) ) {
485  for (k=1; k <= right; k++) if(sol==false) {
486  u_cog = 0 ;
487  v_cog = 0 ;
488  ip_connexities_list.clear() ;
489  ip_edges_list.clear();
490 
491  this->mean_gray_level = 0 ;
492  if ( connexe(I, (unsigned int)u_+k, (unsigned int)(v_),mean_gray_level, u_cog, v_cog, npoint) ) {
493  sol = true; u = u_+k; v = v_;
494  }
495  }
496  u_ += k;
497  right += 2;
498 
499  for (k=1; k <= botom; k++) if (sol==false) {
500  u_cog = 0 ;
501  v_cog = 0 ;
502  ip_connexities_list.clear() ;
503  ip_edges_list.clear();
504 
505  this->mean_gray_level = 0 ;
506 
507  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_+k),mean_gray_level, u_cog, v_cog, npoint) ) {
508  sol = true; u = u_; v = v_+k;
509  }
510  }
511  v_ += k;
512  botom += 2;
513 
514  for (k=1; k <= left; k++) if (sol==false) {
515  u_cog = 0 ;
516  v_cog = 0 ;
517  ip_connexities_list.clear() ;
518  ip_edges_list.clear();
519 
520  this->mean_gray_level = 0 ;
521 
522  if ( connexe(I, (unsigned int)(u_-k), (unsigned int)(v_),mean_gray_level,u_cog, v_cog, npoint) ) {
523  sol = true ; u = u_-k; v = v_;
524  }
525  }
526  u_ -= k;
527  left += 2;
528 
529  for (k=1; k <= up; k++) if(sol==false) {
530  u_cog = 0 ;
531  v_cog = 0 ;
532  ip_connexities_list.clear() ;
533  ip_edges_list.clear();
534 
535  this->mean_gray_level = 0 ;
536 
537  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_-k),mean_gray_level,u_cog, v_cog, npoint) ) {
538  sol = true ; u = u_; v = v_-k;
539  }
540  }
541  v_ -= k;
542  up += 2;
543  }
544 
545  if (sol == false) {
546  //vpERROR_TRACE("Dot has been lost") ;
548  "Dot has been lost")) ;
549  }
550  }
551 
552 #endif
553 /*
554  vpImagePoint ip;
555  unsigned int i, j;
556  std::list<vpImagePoint>::iterator it;
557  for (it = ip_connexities_list.begin(); it != ip_connexities_list.end(); it ++) {
558  ip = *it;
559  i = (unsigned int) ip.get_i();
560  j = (unsigned int) ip.get_j();
561  I[i][j] = 255 ;
562  }*/
563 
564  u_cog = u_cog/npoint ;
565  v_cog = v_cog/npoint ;
566 
567  u = u_cog ;
568  v = v_cog ;
569 
570  // Initialize the threshold for the next call to track()
571  double Ip = pow((double)this->mean_gray_level/255,1/gamma);
572 
573  if(Ip - (1 - grayLevelPrecision)<0){
574  gray_level_min = 0 ;
575  }
576  else{
577  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
578  if (gray_level_min > 255)
579  gray_level_min = 255;
580  }
581  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
582  if (gray_level_max > 255)
583  gray_level_max = 255;
584 
585  //vpCTRACE << "gray_level_min: " << gray_level_min << std::endl;
586  //vpCTRACE << "gray_level_max: " << gray_level_max << std::endl;
587 
588  if (npoint < 5)
589  {
590  //vpERROR_TRACE("Dot to small") ;
592  "Dot to small")) ;
593  }
594 
595  if (npoint > nbMaxPoint)
596  {
597 // vpERROR_TRACE("Too many point %lf (%lf%%). Max allowed is %lf (%lf%%). This threshold can be modified using the setMaxDotSize() method.",
598 // npoint, npoint / (I.getWidth() * I.getHeight()),
599 // nbMaxPoint, maxDotSizePercentage) ;
600 
602  "Too many point %lf (%lf%%). Max allowed is %lf (%lf%%). This threshold can be modified using the setMaxDotSize() method.",
603  npoint, npoint / (I.getWidth() * I.getHeight()),
604  nbMaxPoint, maxDotSizePercentage)) ;
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(vpException &e)
683  {
684  throw(e) ;
685  }
686 }
687 
711 void
713 {
714 
715  cog = ip ;
716 
717  unsigned int i = (unsigned int)cog.get_i();
718  unsigned int j = (unsigned int)cog.get_j();
719 
720  double Ip = pow((double)I[i][j]/255, 1/gamma);
721 
722  if(Ip - (1 - grayLevelPrecision)<0){
723  gray_level_min = 0 ;
724  }
725  else{
726  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
727  if (gray_level_min > 255)
728  gray_level_min = 255;
729  }
730  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
731  if (gray_level_max > 255)
732  gray_level_max = 255;
733  try {
734  track( I );
735  }
736  catch(vpException &e)
737  {
738  throw(e) ;
739  }
740 }
741 
769 void
771  unsigned int level_min, unsigned int level_max)
772 {
773 
774  cog = ip ;
775 
776  this->gray_level_min = level_min;
777  this->gray_level_max = level_max;
778 
779  try {
780  track( I );
781  }
782  catch(vpException &e)
783  {
784  throw(e) ;
785  }
786 }
787 
788 
803 void
805 {
806  try{
807  setGrayLevelOut();
808  double u = this->cog.get_u();
809  double v = this->cog.get_v();
810 
811  COG( I, u, v ) ;
812 
813  this->cog.set_u( u );
814  this->cog.set_v( v );
815 
816  if (compute_moment==true)
817  {
818  mu11 = m11 - u*m01;
819  mu02 = m02 - v*m01;
820  mu20 = m20 - u*m10;
821  }
822 
823  if (graphics) {
824  // display a red cross at the center of gravity's location in the image.
825  vpDisplay::displayCross(I, this->cog, 3*thickness+8, vpColor::red, thickness);
826  }
827 
828  }
829  catch(vpException &e)
830  {
831  throw(e) ;
832  }
833 }
834 
849 void
851 {
852  track( I ) ;
853 
854  ip = this->cog;
855 }
856 
864 void vpDot::display(const vpImage<unsigned char>& I, vpColor color, unsigned int thick) const
865 {
866  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thick);
867  std::list<vpImagePoint>::const_iterator it;
868 
869  for (it = ip_edges_list.begin(); it != ip_edges_list.end(); ++it)
870  {
871  vpDisplay::displayPoint(I, *it, color);
872  }
873 }
874 
892 void vpDot::setGrayLevelPrecision( const double & precision )
893 {
894  double epsilon = 0.05;
895  if( grayLevelPrecision<epsilon )
896  {
897  this->grayLevelPrecision = epsilon;
898  }
899  else if( grayLevelPrecision>1 )
900  {
901  this->grayLevelPrecision = 1.0;
902  }
903  else
904  {
905  this->grayLevelPrecision = precision;
906  }
907 }
908 
924  const std::list<vpImagePoint> &edges_list, vpColor color,
925  unsigned int thickness)
926 {
927  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
928  std::list<vpImagePoint>::const_iterator it;
929 
930  for (it = edges_list.begin(); it != edges_list.end(); ++it)
931  {
932  vpDisplay::displayPoint(I, *it, color);
933  }
934 }
935 
950 void vpDot::display(const vpImage<vpRGBa>& I,const vpImagePoint &cog,
951  const std::list<vpImagePoint> &edges_list, vpColor color,
952  unsigned int thickness)
953 {
954  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
955  std::list<vpImagePoint>::const_iterator it;
956 
957  for (it = edges_list.begin(); it != edges_list.end(); ++it)
958  {
959  vpDisplay::displayPoint(I, *it, color);
960  }
961 }
962 
968 VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpDot& d) {
969  return (os << "(" << d.getCog() << ")" ) ;
970 } ;
971 
972 
double get_v() const
Definition: vpImagePoint.h:264
double mu20
Definition: vpDot.h:187
bool operator!=(const vpDot &d)
Definition: vpDot.cpp:185
void setMaxDotSize(double percentage)
Definition: vpDot.cpp:621
double get_i() const
Definition: vpImagePoint.h:195
unsigned int getWidth() const
Definition: vpImage.h:161
void setGrayLevelPrecision(const double &grayLevelPrecision)
Definition: vpDot.cpp:892
double m10
Definition: vpDot.h:148
#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:253
void track(const vpImage< unsigned char > &I)
Definition: vpDot.cpp:804
double m00
Definition: vpDot.h:134
error that can be emited by ViSP classes.
Definition: vpException.h:76
double mu11
Definition: vpDot.h:182
double mu02
Definition: vpDot.h:192
double get_j() const
Definition: vpImagePoint.h:206
static const unsigned int SPIRAL_SEARCH_SIZE
Definition: vpDot.h:132
double m20
Definition: vpDot.h:164
double m11
Definition: vpDot.h:155
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:228
double m01
Definition: vpDot.h:141
Error that can be emited by the vpTracker class and its derivates.
vpDot & operator=(const vpDot &d)
Copy operator.
Definition: vpDot.cpp:146
void set_u(const double u)
Definition: vpImagePoint.h:217
void display(const vpImage< unsigned char > &I, vpColor color=vpColor::red, unsigned int thickness=1) const
Definition: vpDot.cpp:864
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:228
double m02
Definition: vpDot.h:173
vpDot()
Definition: vpDot.cpp:96
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage...
Definition: vpDot.h:119
unsigned int getHeight() const
Definition: vpImage.h:152
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:93
bool operator==(const vpDot &d)
Definition: vpDot.cpp:191
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:137