Visual Servoing Platform  version 3.3.0 under development (2020-02-17)
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:
69 #else
70 protected:
71 #endif
72  std::list<vpMeSite> list;
76  vpMe *me;
77  unsigned int init_range;
81 
82 protected:
84 
85 public:
86  // Constructor/Destructor
87  vpMeTracker();
88  vpMeTracker(const vpMeTracker &meTracker);
89  virtual ~vpMeTracker();
90 
91  void init();
92  void initTracking(const vpImage<unsigned char> &I);
93 
95  void track(const vpImage<unsigned char> &I);
96 
97  unsigned int numberOfSignal();
98  unsigned int totalNumberOfSignal();
99 
100  virtual void display(const vpImage<unsigned char> &I, vpColor col) = 0;
101  virtual void display(const vpImage<unsigned char> &I);
102  virtual void display(const vpImage<vpRGBa> &I);
103  void display(const vpImage<unsigned char> &I, vpColVector &w, unsigned int &index_w);
104 
105  void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select; }
106 
108 
109  static bool inMask(const vpImage<bool> *mask, unsigned int i, unsigned int j);
110 
111  int outOfImage(int i, int j, int half, int row, int cols);
112  int outOfImage(const vpImagePoint &iP, int half, int rows, int cols);
113 
114  void reset();
115 
117  virtual void sample(const vpImage<unsigned char> &image, bool doNotTrack=false) = 0;
118 
124  void setInitRange(const unsigned int &r) { init_range = r; }
125 
131  inline unsigned int getInitRange() { return init_range; }
132 
138  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
139 
145  void setMe(vpMe *p_me) { this->me = p_me; }
146 
152  inline vpMe *getMe() { return me; }
153 
159  void setMeList(const std::list<vpMeSite> &l) { list = l; }
160 
166  inline std::list<vpMeSite> &getMeList() { return list; }
167  inline std::list<vpMeSite> getMeList() const { return list; }
168 
174  inline int getNbPoints() const { return nGoodElement; }
175 
176 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
177 public:
179  bool display_point; // if 1 (TRUE) displays the line that is being tracked
180 #endif
181 };
182 
183 #endif
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:159
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:53
int getNbPoints() const
Definition: vpMeTracker.h:174
Class to define colors available for display functionnalities.
Definition: vpColor.h:119
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMeTracker.h:138
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:80
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:64
unsigned int getInitRange()
Definition: vpMeTracker.h:131
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:105
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:124
vpMe * getMe()
Definition: vpMeTracker.h:152
bool display_point
Definition: vpMeTracker.h:179
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:65
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:166
int nGoodElement
Definition: vpMeTracker.h:78
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:167
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
vpMe * me
Moving edges initialisation parameters.
Definition: vpMeTracker.h:76
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:88
void setMe(vpMe *p_me)
Definition: vpMeTracker.h:145
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:83
unsigned int init_range
Definition: vpMeTracker.h:77