Visual Servoing Platform  version 3.4.1 under development (2021-04-20)
vpMeTracker.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Moving edges.
33  *
34  * Authors:
35  * Andrew Comport
36  * Aurelien Yol
37  *
38  *****************************************************************************/
39 
45 #ifndef vpMeTracker_HH
46 #define vpMeTracker_HH
47 
48 #include <visp3/core/vpColVector.h>
49 #include <visp3/core/vpTracker.h>
50 #include <visp3/me/vpMe.h>
51 #include <visp3/me/vpMeSite.h>
52 
53 #include <iostream>
54 #include <list>
55 #include <math.h>
56 
65 class VISP_EXPORT vpMeTracker : public vpTracker
66 {
67 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
68 public:
71 #else
72 protected:
75 #endif
76  std::list<vpMeSite> list;
80  vpMe *me;
81  unsigned int init_range;
86 
87 protected:
92 
93 public:
94  // Constructor/Destructor
95  vpMeTracker();
96  vpMeTracker(const vpMeTracker &meTracker);
97  virtual ~vpMeTracker();
98 
101  virtual void display(const vpImage<unsigned char> &I, vpColor col) = 0;
102  virtual void display(const vpImage<unsigned char> &I);
103  virtual void display(const vpImage<vpRGBa> &I);
104  void display(const vpImage<unsigned char> &I, vpColVector &w, unsigned int &index_w);
105 
106  static bool inMask(const vpImage<bool> *mask, unsigned int i, unsigned int j);
107 
113  inline unsigned int getInitRange() { return init_range; }
114 
120  inline vpMe *getMe() { return me; }
121 
127  inline std::list<vpMeSite> &getMeList() { return list; }
128  inline std::list<vpMeSite> getMeList() const { return list; }
129 
135  inline int getNbPoints() const { return nGoodElement; }
136 
137  void init();
138  void initTracking(const vpImage<unsigned char> &I);
139 
140  unsigned int numberOfSignal();
141 
143 
144  int outOfImage(int i, int j, int half, int row, int cols);
145  int outOfImage(const vpImagePoint &iP, int half, int rows, int cols);
146 
147  void reset();
148 
150  virtual void sample(const vpImage<unsigned char> &image, bool doNotTrack=false) = 0;
151 
152  void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select; }
153 
159  void setInitRange(const unsigned int &r) { init_range = r; }
160 
166  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
167 
173  void setMe(vpMe *p_me) { this->me = p_me; }
174 
180  void setMeList(const std::list<vpMeSite> &l) { list = l; }
181 
182  unsigned int totalNumberOfSignal();
183 
185  void track(const vpImage<unsigned char> &I);
187 
188 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
189 public:
193  bool display_point; // if 1 (TRUE) displays the line that is being tracked
195 #endif
196 };
197 
198 #endif
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:180
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:53
int getNbPoints() const
Definition: vpMeTracker.h:135
Class to define RGB colors available for display functionnalities.
Definition: vpColor.h:157
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMeTracker.h:166
Definition: vpMe.h:60
vpMeSiteDisplayType
Definition: vpMeSite.h:74
const vpImage< bool > * m_mask
Mask used to disable tracking on a part of image.
Definition: vpMeTracker.h:84
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:64
unsigned int getInitRange()
Definition: vpMeTracker.h:113
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:152
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:159
vpMe * getMe()
Definition: vpMeTracker.h:120
bool display_point
Definition: vpMeTracker.h:193
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:65
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:127
int nGoodElement
Definition: vpMeTracker.h:82
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:128
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
vpMe * me
Moving edges initialisation parameters.
Definition: vpMeTracker.h:80
void init()
Default initialization.
Definition: vpTracker.cpp:47
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:87
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:173
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:90
unsigned int init_range
Definition: vpMeTracker.h:81