ViSP  2.10.0
vpMeTracker.h
1 /****************************************************************************
2  *
3  * $Id: vpMeTracker.h 4797 2014-07-23 15:52:28Z 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  * Moving edges.
36  *
37  * Authors:
38  * Andrew Comport
39  * Aurelien Yol
40  *
41  *****************************************************************************/
42 
48 // ===================================================================
57 // ===================================================================
58 
59 #ifndef vpMeTracker_HH
60 #define vpMeTracker_HH
61 
62 #include <visp/vpColVector.h>
63 #include <visp/vpMeSite.h>
64 #include <visp/vpMe.h>
65 #include <visp/vpTracker.h>
66 
67 #include <math.h>
68 #include <iostream>
69 #include <list>
70 
71 class VISP_EXPORT vpMeTracker : public vpTracker
72 {
73 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
74 public:
75 #else
76 protected:
77 #endif
78  std::list<vpMeSite> list ;
82  vpMe *me ;
83  unsigned int init_range;
85 
86 protected:
88 
89 public:
90  // Constructor/Destructor
91  vpMeTracker() ;
92  vpMeTracker(const vpMeTracker& meTracker) ;
93  virtual ~vpMeTracker() ;
94 
95  void init() ;
96  void initTracking(const vpImage<unsigned char>& I);
97 
99  void track(const vpImage<unsigned char>& I);
100 
101  unsigned int numberOfSignal() ;
102  unsigned int totalNumberOfSignal() ;
103 
104  virtual void display(const vpImage<unsigned char> &I, vpColor col)=0;
105  virtual void display(const vpImage<unsigned char>& I);
106  void display(const vpImage<unsigned char>& I, vpColVector &w, unsigned int &index_w);
107 
109  selectDisplay = select ;
110  }
111 
113 
114  int outOfImage( int i , int j , int half , int rows , int cols) ;
115  int outOfImage( vpImagePoint iP , int half , int rows , int cols) ;
116 
117  void reset();
118 
120  virtual void sample(const vpImage<unsigned char> &image)=0;
121 
122 
128  void setInitRange(const unsigned int &r) { init_range = r; }
129 
135  inline unsigned int getInitRange() { return init_range; }
136 
142  void setMe(vpMe *p_me) { this->me = p_me ; }
143 
149  inline vpMe* getMe(){ return me; }
150 
156  void setMeList(const std::list<vpMeSite> &l) { list = l; }
157 
163  inline std::list<vpMeSite>& getMeList() { return list; }
164  inline std::list<vpMeSite> getMeList() const { return list; }
165 
171  inline int getNbPoints() const { return nGoodElement; }
172 
173 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
174 public:
176  bool display_point;// if 1 (TRUE) displays the line that is being tracked
177 #endif
178 };
179 
180 
181 #endif
182 
183 
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:156
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:69
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:164
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
vpMeSiteDisplayType
Definition: vpMeSite.h:79
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:69
unsigned int getInitRange()
Definition: vpMeTracker.h:135
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:108
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:128
vpMe * getMe()
Definition: vpMeTracker.h:149
bool display_point
Definition: vpMeTracker.h:176
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:71
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:163
int nGoodElement
Definition: vpMeTracker.h:84
int getNbPoints() const
Definition: vpMeTracker.h:171
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
vpMe * me
Moving edges initialisation parameters.
Definition: vpMeTracker.h:82
void init()
Default initialization.
Definition: vpTracker.cpp:54
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:93
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:142
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:87
unsigned int init_range
Definition: vpMeTracker.h:83