Visual Servoing Platform  version 3.0.0
vpDot.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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  * Description:
31  * Track a white dot.
32  *
33  * Authors:
34  * Eric Marchand
35  * Fabien Spindler
36  * Aurelien Yol
37  *
38  *****************************************************************************/
39 
40 /*
41  \file vpDot.cpp
42  \brief Track a white dot
43 */
44 
45 #include <visp3/blob/vpDot.h>
46 #include <visp3/core/vpDisplay.h>
47 #include <visp3/core/vpColor.h>
48 #include <visp3/core/vpTrackingException.h>
49 
50 #include <vector>
51 
52 /*
53  \class vpDot
54  \brief Track a white dot
55 */
56 
57 /* spiral size for the dot search */
58 const unsigned int vpDot::SPIRAL_SEARCH_SIZE = 350;
59 
66 void vpDot::init()
67 {
68  cog.set_u(0);
69  cog.set_v(0);
70 
71  compute_moment = false ;
72  graphics = false ;
73  thickness = 1;
74  maxDotSizePercentage = 0.25 ; // 25 % of the image size
75 
76  mean_gray_level = 0;
77  gray_level_min = 128;
78  gray_level_max = 255;
79  grayLevelPrecision = 0.85;
80  gamma = 1.5 ;
81 
82  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu02 = mu20 = 0 ;
83 
84  connexityType = CONNEXITY_4;
85 
86  u_min = u_max = v_min = v_max = 0;
87 
88  gray_level_out = 0;
89  nbMaxPoint = 0;
90 }
91 
93  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
94  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
95  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
96  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
97  gamma(1.5), compute_moment(false), nbMaxPoint(0)
98 {
99 }
100 
107  : m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
108  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
109  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
110  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
111  gamma(1.5), compute_moment(false), nbMaxPoint(0)
112 {
113  cog = ip;
114 }
115 
120  : vpTracker(d),
121  m00(0.), m01(0.), m10(0.), m11(0.), m20(0.), m02(0.),
122  mu11(0.), mu20(0.), mu02(0.), ip_connexities_list(), ip_edges_list(), connexityType(CONNEXITY_4),
123  cog(), u_min(0), u_max(0), v_min(0), v_max(0), graphics(false), thickness(1), maxDotSizePercentage(0.25),
124  gray_level_out(0), mean_gray_level(0), gray_level_min(128), gray_level_max(255), grayLevelPrecision(0.85),
125  gamma(1.5), compute_moment(false), nbMaxPoint(0)
126 {
127  *this = d ;
128 }
129 
134 {
135  ip_connexities_list.clear() ;
136 }
137 
141 vpDot&
143 {
144  ip_edges_list = d.ip_edges_list;
145  ip_connexities_list = d.ip_connexities_list;
146  connexityType = d.connexityType;
147  cog = d.getCog();
148 
149  u_min = d.u_min;
150  v_min = d.v_min;
151  u_max = d.u_max;
152  v_max = d.v_max;
153 
154  graphics = d.graphics ;
155  thickness = d.thickness;
156  maxDotSizePercentage = d.maxDotSizePercentage;
157  gray_level_out = d.gray_level_out;
158  mean_gray_level = d.mean_gray_level ;
159  gray_level_min = d.gray_level_min ;
160  gray_level_max = d.gray_level_max ;
161  grayLevelPrecision = d.grayLevelPrecision;
162  gamma = d.gamma;
163  compute_moment = d.compute_moment ;
164  nbMaxPoint = d.nbMaxPoint;
165 
166  m00 = d.m00;
167  m01 = d.m01;
168  m10 = d.m10;
169  m11 = d.m11;
170  m02 = d.m02;
171  m20 = d.m20;
172 
173  mu11 = d.mu11;
174  mu20 = d.mu20;
175  mu02 = d.mu02;
176 
177  return *this ;
178 }
179 
180 bool
182 {
183  return ( cog != d.getCog() );
184 }
185 
186 bool
188 {
189  return ( cog == d.getCog() );
190 }
191 
203 void
204 vpDot::setGrayLevelOut()
205 {
206  if (gray_level_min == 0) {
207  if (gray_level_max == 255) {
208  // gray_level_min = 0 and gray_level_max = 255: this should not occur
209  //vpERROR_TRACE("Unable to choose a good \"out\" level") ;
211  "Unable to choose a good \"out\" level")) ;
212  }
213  gray_level_out = static_cast<unsigned char>(gray_level_max + 1u);
214  }
215 }
216 
234 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
235  double &mean_value, double &u_cog, double &v_cog, double &n)
236 {
237  std::vector<bool> checkTab(I.getWidth()*I.getHeight(),false);
238  return connexe(I,u,v,mean_value,u_cog,v_cog,n,checkTab);
239 }
257 bool vpDot::connexe(const vpImage<unsigned char>& I,unsigned int u,unsigned int v,
258  double &mean_value, double &u_cog, double &v_cog, double &n,std::vector<bool> &checkTab)
259 {
260 
261  unsigned int width = I.getWidth();
262  unsigned int height= I.getHeight();
263 
264  // Test if we are in the image
265  if ( (u >= width) || (v >= height) )
266  {
267  //std::cout << "out of bound" << std::endl;
268  return false;
269  }
270 
271  if(checkTab[u + v*I.getWidth()])
272  return true;
273 
274  vpImagePoint ip;
275  ip.set_u(u);
276  ip.set_v(v);
277 
278  if (I[v][u] >= gray_level_min && I[v][u] <= gray_level_max)
279  {
280  checkTab[v*I.getWidth() + u] = true;
281 
282  ip_connexities_list.push_back(ip);
283 
284  u_cog += u ;
285  v_cog += v ;
286  n+=1 ;
287 
288  if (n > nbMaxPoint) {
289 // vpERROR_TRACE("Too many point %lf (%lf%% of image size). "
290 // "This threshold can be modified using the setMaxDotSize() "
291 // "method.",
292 // n, n / (I.getWidth() * I.getHeight()),
293 // nbMaxPoint, maxDotSizePercentage) ;
294 
296  "Too many point %lf (%lf%% of image size). "
297  "This threshold can be modified using the setMaxDotSize() "
298  "method.",
299  n, n / (I.getWidth() * I.getHeight()),
300  nbMaxPoint, maxDotSizePercentage)) ;
301  }
302 
303  // Bounding box update
304  if (u < this->u_min) this->u_min = u;
305  if (u > this->u_max) this->u_max = u;
306  if (v < this->v_min) this->v_min = v;
307  if (v > this->v_max) this->v_max = v;
308 
309  // Mean value of the dot intensities
310  mean_value = (mean_value *(n-1) + I[v][u]) / n;
311  if (compute_moment==true)
312  {
313  m00++ ;
314  m10 += u ;
315  m01 += v ;
316  m11 += (u*v) ;
317  m20 += u*u ;
318  m02 += v*v ;
319  }
320  }
321  else
322  {
323  //std::cout << "not in" << std::endl;
324  return false;
325  }
326 
327  bool edge = false;
328 
329  //if((int)u-1 >= 0)
330  if(u >= 1)
331  if(!checkTab[u-1 + v*I.getWidth()])
332  if(!connexe(I,u-1,v, mean_value,u_cog,v_cog, n, checkTab))
333  edge = true;
334 
335  if(u+1 < I.getWidth())
336  if(!checkTab[u+1+v*I.getWidth()])
337  if(!connexe(I,u+1,v,mean_value,u_cog, v_cog, n, checkTab))
338  edge = true;
339 
340  if(v >= 1)
341  if(!checkTab[u+(v-1)*I.getWidth()])
342  if(!connexe(I,u, v-1,mean_value,u_cog, v_cog, n, checkTab))
343  edge = true;
344 
345  if(v+1 < I.getHeight())
346  if(!checkTab[u+(v+1)*I.getWidth()])
347  if(!connexe(I,u,v+1,mean_value,u_cog, v_cog, n, checkTab))
348  edge = true;
349 
350  if (connexityType == CONNEXITY_8) {
351  if(v >= 1 && u >= 1)
352  if(!checkTab[u-1+(v-1)*I.getWidth()])
353  if(!connexe(I,u-1,v-1,mean_value,u_cog, v_cog, n, checkTab))
354  edge = true;
355 
356  if(v >= 1 && u+1 < I.getWidth())
357  if(!checkTab[u+1+(v-1)*I.getWidth()])
358  if(!connexe(I,u+1,v-1,mean_value,u_cog, v_cog, n, checkTab))
359  edge = true;
360 
361  if(v+1 < I.getHeight() && u >= 1)
362  if(!checkTab[u-1+(v+1)*I.getWidth()])
363  if(!connexe(I,u-1,v+1,mean_value, u_cog, v_cog, n, checkTab))
364  edge = true;
365 
366  if(v+1 < I.getHeight() && u+1 < I.getWidth())
367  if(!checkTab[u+1+(v+1)*I.getWidth()])
368  if(!connexe(I,u+1,v+1,mean_value,u_cog, v_cog, n, checkTab))
369  edge = true;
370  }
371 
372  if(edge){
373  ip_edges_list.push_back(ip);
374  if (graphics==true)
375  {
376  vpImagePoint ip_(ip);
377  for(unsigned int t=0; t<thickness; t++) {
378  ip_.set_u(ip.get_u() + t);
380  }
381  //vpDisplay::flush(I);
382  }
383  }
384 
385  return true;
386 }
387 
407 void
408 vpDot::COG(const vpImage<unsigned char> &I, double& u, double& v)
409 {
410  // Set the maximal number of points considering the maximal dot size
411  // image percentage
412  nbMaxPoint = (I.getWidth() * I.getHeight()) * maxDotSizePercentage;
413 
414  // segmentation de l'image apres seuillage
415  // (etiquetage des composante connexe)
416  if (compute_moment)
417  m00 = m11 = m02 = m20 = m10 = m01 = mu11 = mu20 = mu02 = 0;
418 
419  double u_cog = 0 ;
420  double v_cog = 0 ;
421  double npoint = 0 ;
422  this->mean_gray_level = 0 ;
423 
424  ip_connexities_list.clear() ;
425  ip_edges_list.clear();
426 
427  // Initialise the boundig box
428  this->u_min = I.getWidth();
429  this->u_max = 0;
430  this->v_min = I.getHeight();
431  this->v_max = 0;
432 
433 #if 0
434  // Original version
435  if ( connexe(I, (unsigned int)u, (unsigned int)v,
436  gray_level_min, gray_level_max,
437  mean_gray_level, u_cog, v_cog, npoint) == vpDot::out)
438  {
439  bool sol = false ;
440  unsigned int pas ;
441  for (pas = 2 ; pas <= 25 ; pas ++ )if (sol==false)
442  {
443  for (int k=-1 ; k <=1 ; k++) if (sol==false)
444  for (int l=-1 ; l <=1 ; l++) if (sol==false)
445  {
446  u_cog = 0 ;
447  v_cog = 0 ;
448  ip_connexities_list.clear() ;
449 
450  this->mean_gray_level = 0 ;
451  if (connexe(I, (unsigned int)(u+k*pas),(unsigned int)(v+l*pas),
452  gray_level_min, gray_level_max,
453  mean_gray_level, u_cog, v_cog, npoint) != vpDot::out)
454  {
455  sol = true ; u += k*pas ; v += l*pas ;
456  }
457  }
458  }
459  if (sol == false)
460  {
461  //vpERROR_TRACE("Dot has been lost") ;
463  "Dot has been lost")) ;
464  }
465  }
466 #else
467  // If the dot is not found, search around using a spiral
468  if ( !connexe(I,(unsigned int)u,(unsigned int)v, mean_gray_level, u_cog, v_cog, npoint) )
469  {
470  bool sol = false ;
471 
472  unsigned int right = 1;
473  unsigned int botom = 1;
474  unsigned int left = 2;
475  unsigned int up = 2;
476  double u_ = u, v_ = v;
477  unsigned int k;
478 
479  // Spiral search from the center to find the nearest dot
480  while( (right < SPIRAL_SEARCH_SIZE) && (sol == false) ) {
481  for (k=1; k <= right; k++) if(sol==false) {
482  u_cog = 0 ;
483  v_cog = 0 ;
484  ip_connexities_list.clear() ;
485  ip_edges_list.clear();
486 
487  this->mean_gray_level = 0 ;
488  if ( connexe(I, (unsigned int)u_+k, (unsigned int)(v_),mean_gray_level, u_cog, v_cog, npoint) ) {
489  sol = true; u = u_+k; v = v_;
490  }
491  }
492  u_ += k;
493  right += 2;
494 
495  for (k=1; k <= botom; k++) if (sol==false) {
496  u_cog = 0 ;
497  v_cog = 0 ;
498  ip_connexities_list.clear() ;
499  ip_edges_list.clear();
500 
501  this->mean_gray_level = 0 ;
502 
503  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_+k),mean_gray_level, u_cog, v_cog, npoint) ) {
504  sol = true; u = u_; v = v_+k;
505  }
506  }
507  v_ += k;
508  botom += 2;
509 
510  for (k=1; k <= left; k++) if (sol==false) {
511  u_cog = 0 ;
512  v_cog = 0 ;
513  ip_connexities_list.clear() ;
514  ip_edges_list.clear();
515 
516  this->mean_gray_level = 0 ;
517 
518  if ( connexe(I, (unsigned int)(u_-k), (unsigned int)(v_),mean_gray_level,u_cog, v_cog, npoint) ) {
519  sol = true ; u = u_-k; v = v_;
520  }
521  }
522  u_ -= k;
523  left += 2;
524 
525  for (k=1; k <= up; k++) if(sol==false) {
526  u_cog = 0 ;
527  v_cog = 0 ;
528  ip_connexities_list.clear() ;
529  ip_edges_list.clear();
530 
531  this->mean_gray_level = 0 ;
532 
533  if ( connexe(I, (unsigned int)(u_), (unsigned int)(v_-k),mean_gray_level,u_cog, v_cog, npoint) ) {
534  sol = true ; u = u_; v = v_-k;
535  }
536  }
537  v_ -= k;
538  up += 2;
539  }
540 
541  if (sol == false) {
542  //vpERROR_TRACE("Dot has been lost") ;
544  "Dot has been lost")) ;
545  }
546  }
547 
548 #endif
549 /*
550  vpImagePoint ip;
551  unsigned int i, j;
552  std::list<vpImagePoint>::iterator it;
553  for (it = ip_connexities_list.begin(); it != ip_connexities_list.end(); it ++) {
554  ip = *it;
555  i = (unsigned int) ip.get_i();
556  j = (unsigned int) ip.get_j();
557  I[i][j] = 255 ;
558  }*/
559 
560  u_cog = u_cog/npoint ;
561  v_cog = v_cog/npoint ;
562 
563  u = u_cog ;
564  v = v_cog ;
565 
566  // Initialize the threshold for the next call to track()
567  double Ip = pow((double)this->mean_gray_level/255,1/gamma);
568 
569  if(Ip - (1 - grayLevelPrecision)<0){
570  gray_level_min = 0 ;
571  }
572  else{
573  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
574  if (gray_level_min > 255)
575  gray_level_min = 255;
576  }
577  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
578  if (gray_level_max > 255)
579  gray_level_max = 255;
580 
581  //vpCTRACE << "gray_level_min: " << gray_level_min << std::endl;
582  //vpCTRACE << "gray_level_max: " << gray_level_max << std::endl;
583 
584  if (npoint < 5)
585  {
586  //vpERROR_TRACE("Dot to small") ;
588  "Dot to small")) ;
589  }
590 
591  if (npoint > nbMaxPoint)
592  {
593 // vpERROR_TRACE("Too many point %lf (%lf%%). Max allowed is %lf (%lf%%). This threshold can be modified using the setMaxDotSize() method.",
594 // npoint, npoint / (I.getWidth() * I.getHeight()),
595 // nbMaxPoint, maxDotSizePercentage) ;
596 
598  "Too many point %lf (%lf%%). Max allowed is %lf (%lf%%). This threshold can be modified using the setMaxDotSize() method.",
599  npoint, npoint / (I.getWidth() * I.getHeight()),
600  nbMaxPoint, maxDotSizePercentage)) ;
601  }
602 }
603 
616 void
617 vpDot::setMaxDotSize(double percentage)
618 {
619  if (percentage <= 0.0 || percentage > 1.0) {
620  // print a warning. We keep the default percentage
621  vpTRACE("Max dot size percentage is requested to be set to %lf.",
622  "Value should be in ]0:1]. Value will be set to %lf.",
623  percentage, maxDotSizePercentage);
624  }
625  else {
626  maxDotSizePercentage = percentage;
627  }
628 }
629 
653 void
655 {
656  while (vpDisplay::getClick(I, cog) != true) ;
657 
658  unsigned int i = (unsigned int)cog.get_i();
659  unsigned int j = (unsigned int)cog.get_j();
660 
661  double Ip = pow((double)I[i][j]/255, 1/gamma);
662 
663  if(Ip - (1 - grayLevelPrecision)<0){
664  gray_level_min = 0 ;
665  }
666  else{
667  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
668  if (gray_level_min > 255)
669  gray_level_min = 255;
670  }
671  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
672  if (gray_level_max > 255)
673  gray_level_max = 255;
674 
675  try {
676  track( I );
677  }
678  catch(vpException &e)
679  {
680  throw(e) ;
681  }
682 }
683 
707 void
709 {
710 
711  cog = ip ;
712 
713  unsigned int i = (unsigned int)cog.get_i();
714  unsigned int j = (unsigned int)cog.get_j();
715 
716  double Ip = pow((double)I[i][j]/255, 1/gamma);
717 
718  if(Ip - (1 - grayLevelPrecision)<0){
719  gray_level_min = 0 ;
720  }
721  else{
722  gray_level_min = (unsigned int) (255*pow(Ip - (1 - grayLevelPrecision),gamma));
723  if (gray_level_min > 255)
724  gray_level_min = 255;
725  }
726  gray_level_max = (unsigned int) (255*pow(Ip + (1 - grayLevelPrecision),gamma));
727  if (gray_level_max > 255)
728  gray_level_max = 255;
729  try {
730  track( I );
731  }
732  catch(vpException &e)
733  {
734  throw(e) ;
735  }
736 }
737 
765 void
767  unsigned int level_min, unsigned int level_max)
768 {
769 
770  cog = ip ;
771 
772  this->gray_level_min = level_min;
773  this->gray_level_max = level_max;
774 
775  try {
776  track( I );
777  }
778  catch(vpException &e)
779  {
780  throw(e) ;
781  }
782 }
783 
784 
799 void
801 {
802  try{
803  setGrayLevelOut();
804  double u = this->cog.get_u();
805  double v = this->cog.get_v();
806 
807  COG( I, u, v ) ;
808 
809  this->cog.set_u( u );
810  this->cog.set_v( v );
811 
812  if (compute_moment==true)
813  {
814  mu11 = m11 - u*m01;
815  mu02 = m02 - v*m01;
816  mu20 = m20 - u*m10;
817  }
818 
819  if (graphics) {
820  // display a red cross at the center of gravity's location in the image.
821  vpDisplay::displayCross(I, this->cog, 3*thickness+8, vpColor::red, thickness);
822  }
823 
824  }
825  catch(vpException &e)
826  {
827  throw(e) ;
828  }
829 }
830 
845 void
847 {
848  track( I ) ;
849 
850  ip = this->cog;
851 }
852 
860 void vpDot::display(const vpImage<unsigned char>& I, vpColor color, unsigned int thick) const
861 {
862  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thick);
863  std::list<vpImagePoint>::const_iterator it;
864 
865  for (it = ip_edges_list.begin(); it != ip_edges_list.end(); ++it)
866  {
867  vpDisplay::displayPoint(I, *it, color);
868  }
869 }
870 
888 void vpDot::setGrayLevelPrecision( const double & precision )
889 {
890  double epsilon = 0.05;
891  if( grayLevelPrecision<epsilon )
892  {
893  this->grayLevelPrecision = epsilon;
894  }
895  else if( grayLevelPrecision>1 )
896  {
897  this->grayLevelPrecision = 1.0;
898  }
899  else
900  {
901  this->grayLevelPrecision = precision;
902  }
903 }
904 
920  const std::list<vpImagePoint> &edges_list, vpColor color,
921  unsigned int thickness)
922 {
923  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
924  std::list<vpImagePoint>::const_iterator it;
925 
926  for (it = edges_list.begin(); it != edges_list.end(); ++it)
927  {
928  vpDisplay::displayPoint(I, *it, color);
929  }
930 }
931 
946 void vpDot::display(const vpImage<vpRGBa>& I,const vpImagePoint &cog,
947  const std::list<vpImagePoint> &edges_list, vpColor color,
948  unsigned int thickness)
949 {
950  vpDisplay::displayCross(I, cog, 3*thickness+8, color, thickness);
951  std::list<vpImagePoint>::const_iterator it;
952 
953  for (it = edges_list.begin(); it != edges_list.end(); ++it)
954  {
955  vpDisplay::displayPoint(I, *it, color);
956  }
957 }
958 
964 VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpDot& d) {
965  return (os << "(" << d.getCog() << ")" ) ;
966 } ;
967 
968 
double get_v() const
Definition: vpImagePoint.h:259
double mu20
Definition: vpDot.h:183
bool operator!=(const vpDot &d)
Definition: vpDot.cpp:181
void setMaxDotSize(double percentage)
Definition: vpDot.cpp:617
double get_i() const
Definition: vpImagePoint.h:190
unsigned int getWidth() const
Definition: vpImage.h:161
void setGrayLevelPrecision(const double &grayLevelPrecision)
Definition: vpDot.cpp:888
double m10
Definition: vpDot.h:144
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
double get_u() const
Definition: vpImagePoint.h:248
void track(const vpImage< unsigned char > &I)
Definition: vpDot.cpp:800
double m00
Definition: vpDot.h:130
error that can be emited by ViSP classes.
Definition: vpException.h:73
double mu11
Definition: vpDot.h:178
double mu02
Definition: vpDot.h:188
double get_j() const
Definition: vpImagePoint.h:201
static const unsigned int SPIRAL_SEARCH_SIZE
Definition: vpDot.h:128
double m20
Definition: vpDot.h:160
double m11
Definition: vpDot.h:151
static const vpColor red
Definition: vpColor.h:163
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:66
vpImagePoint getCog() const
Definition: vpDot.h:224
double m01
Definition: vpDot.h:137
Error that can be emited by the vpTracker class and its derivates.
vpDot & operator=(const vpDot &d)
Copy operator.
Definition: vpDot.cpp:142
void set_u(const double u)
Definition: vpImagePoint.h:212
#define vpTRACE
Definition: vpDebug.h:414
void display(const vpImage< unsigned char > &I, vpColor color=vpColor::red, unsigned int thickness=1) const
Definition: vpDot.cpp:860
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:223
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Definition: vpArray2D.h:267
double m02
Definition: vpDot.h:169
vpDot()
Definition: vpDot.cpp:92
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage...
Definition: vpDot.h:115
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:88
bool operator==(const vpDot &d)
Definition: vpDot.cpp:187
void initTracking(const vpImage< unsigned char > &I)
Definition: vpDot.cpp:654
virtual void displayPoint(const vpImagePoint &ip, const vpColor &color)=0
virtual ~vpDot()
Destructor.
Definition: vpDot.cpp:133