Visual Servoing Platform  version 3.6.1 under development (2023-12-02)
vpMeTracker.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
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 https://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 
39 #ifndef _vpMeTracker_h_
40 #define _vpMeTracker_h_
41 
42 #include <visp3/core/vpColVector.h>
43 #include <visp3/core/vpTracker.h>
44 #include <visp3/me/vpMe.h>
45 #include <visp3/me/vpMeSite.h>
46 
47 #include <iostream>
48 #include <list>
49 #include <math.h>
50 
59 class VISP_EXPORT vpMeTracker : public vpTracker
60 {
61 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
62 public:
65 #else
66 protected:
69 #endif
72  std::list<vpMeSite> list;
74  vpMe *me;
76  unsigned int init_range;
82 
83 protected:
88 
89 public:
93  vpMeTracker();
94 
98  vpMeTracker(const vpMeTracker &meTracker);
99 
103  virtual ~vpMeTracker() override;
104 
107 
120  void display(const vpImage<unsigned char> &I);
121 
134  void display(const vpImage<vpRGBa> &I);
135 
143  void display(const vpImage<unsigned char> &I, vpColVector &w, unsigned int &index_w);
144 
154  static bool inMask(const vpImage<bool> *mask, unsigned int i, unsigned int j);
155 
161  inline unsigned int getInitRange() { return init_range; }
162 
168  inline vpMe *getMe() { return me; }
169 
175  inline std::list<vpMeSite> &getMeList() { return list; }
176 
182  inline std::list<vpMeSite> getMeList() const { return list; }
183 
189  inline int getNbPoints() const { return nGoodElement; }
190 
194  void init();
195 
203  void initTracking(const vpImage<unsigned char> &I);
204 
208  unsigned int numberOfSignal();
209 
214 
218  int outOfImage(int i, int j, int half, int row, int cols);
222  int outOfImage(const vpImagePoint &iP, int half, int rows, int cols);
223 
227  void reset();
228 
232  virtual void sample(const vpImage<unsigned char> &image, bool doNotTrack = false) = 0;
233 
238  void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select; }
239 
245  void setInitRange(const unsigned int &r) { init_range = r; }
246 
252  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
253 
259  void setMe(vpMe *p_me) { this->me = p_me; }
260 
266  void setMeList(const std::list<vpMeSite> &l) { list = l; }
267 
271  unsigned int totalNumberOfSignal();
272 
280  void track(const vpImage<unsigned char> &I);
282 
283 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
284 public:
290 #endif
291 };
292 
293 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:163
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:82
vpMeSiteDisplayType
Definition: vpMeSite.h:71
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:60
const vpImage< bool > * m_mask
Mask used to disable tracking on a part of image.
Definition: vpMeTracker.h:80
int nGoodElement
Number of good moving-edges that are tracked.
Definition: vpMeTracker.h:78
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:182
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:86
vpMe * getMe()
Definition: vpMeTracker.h:168
int getNbPoints() const
Definition: vpMeTracker.h:189
virtual void sample(const vpImage< unsigned char > &image, bool doNotTrack=false)=0
std::list< vpMeSite > list
Definition: vpMeTracker.h:72
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:238
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:266
unsigned int init_range
Initial range.
Definition: vpMeTracker.h:76
unsigned int getInitRange()
Definition: vpMeTracker.h:161
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:245
bool display_point
Definition: vpMeTracker.h:288
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:259
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:175
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMeTracker.h:252
vpMe * me
Moving edges initialisation parameters.
Definition: vpMeTracker.h:74
Definition: vpMe.h:120
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:59
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:50
void init()
Default initialization.
Definition: vpTracker.cpp:44