Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
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  void display(const vpImage<unsigned char> &I, vpColVector &w, unsigned int &index_w);
103 
104  void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select; }
105 
107 
108  static bool inMask(const vpImage<bool> *mask, const unsigned int i, const unsigned int j);
109 
110  int outOfImage(int i, int j, int half, int row, int cols);
111  int outOfImage(const vpImagePoint &iP, int half, int rows, int cols);
112 
113  void reset();
114 
116  virtual void sample(const vpImage<unsigned char> &image, const bool doNotTrack=false) = 0;
117 
123  void setInitRange(const unsigned int &r) { init_range = r; }
124 
130  inline unsigned int getInitRange() { return init_range; }
131 
137  virtual void setMask(const vpImage<bool> &mask) { m_mask = &mask; }
138 
144  void setMe(vpMe *p_me) { this->me = p_me; }
145 
151  inline vpMe *getMe() { return me; }
152 
158  void setMeList(const std::list<vpMeSite> &l) { list = l; }
159 
165  inline std::list<vpMeSite> &getMeList() { return list; }
166  inline std::list<vpMeSite> getMeList() const { return list; }
167 
173  inline int getNbPoints() const { return nGoodElement; }
174 
175 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
176 public:
178  bool display_point; // if 1 (TRUE) displays the line that is being tracked
179 #endif
180 };
181 
182 #endif
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:158
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:53
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:166
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
virtual void setMask(const vpImage< bool > &mask)
Definition: vpMeTracker.h:137
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:130
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:104
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:123
vpMe * getMe()
Definition: vpMeTracker.h:151
bool display_point
Definition: vpMeTracker.h:178
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:65
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:165
int nGoodElement
Definition: vpMeTracker.h:78
int getNbPoints() const
Definition: vpMeTracker.h:173
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
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:144
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:83
unsigned int init_range
Definition: vpMeTracker.h:77