Visual Servoing Platform  version 3.0.0
vpMeTracker.h
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  * Moving edges.
32  *
33  * Authors:
34  * Andrew Comport
35  * Aurelien Yol
36  *
37  *****************************************************************************/
38 
44 #ifndef vpMeTracker_HH
45 #define vpMeTracker_HH
46 
47 #include <visp3/core/vpColVector.h>
48 #include <visp3/me/vpMeSite.h>
49 #include <visp3/me/vpMe.h>
50 #include <visp3/core/vpTracker.h>
51 
52 #include <math.h>
53 #include <iostream>
54 #include <list>
55 
64 class VISP_EXPORT vpMeTracker : public vpTracker
65 {
66 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
67 public:
68 #else
69 protected:
70 #endif
71  std::list<vpMeSite> list ;
75  vpMe *me ;
76  unsigned int init_range;
78 
79 protected:
81 
82 public:
83  // Constructor/Destructor
84  vpMeTracker() ;
85  vpMeTracker(const vpMeTracker& meTracker) ;
86  virtual ~vpMeTracker() ;
87 
88  void init() ;
89  void initTracking(const vpImage<unsigned char>& I);
90 
92  void track(const vpImage<unsigned char>& I);
93 
94  unsigned int numberOfSignal() ;
95  unsigned int totalNumberOfSignal() ;
96 
97  virtual void display(const vpImage<unsigned char> &I, vpColor col)=0;
98  virtual void display(const vpImage<unsigned char>& I);
99  void display(const vpImage<unsigned char>& I, vpColVector &w, unsigned int &index_w);
100 
102  selectDisplay = select ;
103  }
104 
106 
107  int outOfImage( int i , int j , int half , int rows , int cols) ;
108  int outOfImage( vpImagePoint iP , int half , int rows , int cols) ;
109 
110  void reset();
111 
113  virtual void sample(const vpImage<unsigned char> &image)=0;
114 
115 
121  void setInitRange(const unsigned int &r) { init_range = r; }
122 
128  inline unsigned int getInitRange() { return init_range; }
129 
135  void setMe(vpMe *p_me) { this->me = p_me ; }
136 
142  inline vpMe* getMe(){ return me; }
143 
149  void setMeList(const std::list<vpMeSite> &l) { list = l; }
150 
156  inline std::list<vpMeSite>& getMeList() { return list; }
157  inline std::list<vpMeSite> getMeList() const { return list; }
158 
164  inline int getNbPoints() const { return nGoodElement; }
165 
166 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
167 public:
169  bool display_point;// if 1 (TRUE) displays the line that is being tracked
170 #endif
171 };
172 
173 
174 #endif
175 
176 
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:149
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:65
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:157
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
Definition: vpMe.h:59
vpMeSiteDisplayType
Definition: vpMeSite.h:75
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:66
unsigned int getInitRange()
Definition: vpMeTracker.h:128
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:101
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:121
vpMe * getMe()
Definition: vpMeTracker.h:142
bool display_point
Definition: vpMeTracker.h:169
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:64
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:156
int nGoodElement
Definition: vpMeTracker.h:77
int getNbPoints() const
Definition: vpMeTracker.h:164
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
vpMe * me
Moving edges initialisation parameters.
Definition: vpMeTracker.h:75
void init()
Default initialization.
Definition: vpTracker.cpp:50
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:135
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:80
unsigned int init_range
Definition: vpMeTracker.h:76