ViSP  2.9.0
vpMeTracker.h
1 /****************************************************************************
2  *
3  * $Id: vpMeTracker.h 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  * 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 
118  virtual void sample(const vpImage<unsigned char> &image)=0;
119 
120 
126  void setInitRange(const unsigned int &r) { init_range = r; }
127 
133  inline unsigned int getInitRange() { return init_range; }
134 
140  void setMe(vpMe *p_me) { this->me = p_me ; }
141 
147  inline vpMe* getMe(){ return me; }
148 
154  void setMeList(const std::list<vpMeSite> &l) { list = l; }
155 
161  inline std::list<vpMeSite>& getMeList() { return list; }
162  inline std::list<vpMeSite> getMeList() const { return list; }
163 
169  inline int getNbPoints() const { return nGoodElement; }
170 
171 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
172 public:
174  bool display_point;// if 1 (TRUE) displays the line that is being tracked
175 #endif
176 };
177 
178 
179 #endif
180 
181 
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:154
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:69
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:162
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:133
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:108
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:126
vpMe * getMe()
Definition: vpMeTracker.h:147
bool display_point
Definition: vpMeTracker.h:174
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:71
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:161
int nGoodElement
Definition: vpMeTracker.h:84
int getNbPoints() const
Definition: vpMeTracker.h:169
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:92
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:140
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:87
unsigned int init_range
Definition: vpMeTracker.h:83