ViSP
 All Classes Functions Variables Enumerations Enumerator Friends Groups Pages
vpMeTracker.h
1 /****************************************************************************
2  *
3  * $Id: vpMeTracker.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 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 
79 
80  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 *me) { this->me = 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