Visual Servoing Platform  version 3.1.0
vpMeTracker.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 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;
79 
80 protected:
82 
83 public:
84  // Constructor/Destructor
85  vpMeTracker();
86  vpMeTracker(const vpMeTracker &meTracker);
87  virtual ~vpMeTracker();
88 
89  void init();
90  void initTracking(const vpImage<unsigned char> &I);
91 
93  void track(const vpImage<unsigned char> &I);
94 
95  unsigned int numberOfSignal();
96  unsigned int totalNumberOfSignal();
97 
98  virtual void display(const vpImage<unsigned char> &I, vpColor col) = 0;
99  virtual void display(const vpImage<unsigned char> &I);
100  void display(const vpImage<unsigned char> &I, vpColVector &w, unsigned int &index_w);
101 
102  void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select; }
103 
105 
106  int outOfImage(int i, int j, int half, int row, int cols);
107  int outOfImage(const vpImagePoint &iP, int half, int rows, int cols);
108 
109  void reset();
110 
112  virtual void sample(const vpImage<unsigned char> &image) = 0;
113 
119  void setInitRange(const unsigned int &r) { init_range = r; }
120 
126  inline unsigned int getInitRange() { return init_range; }
127 
133  void setMe(vpMe *p_me) { this->me = p_me; }
134 
140  inline vpMe *getMe() { return me; }
141 
147  void setMeList(const std::list<vpMeSite> &l) { list = l; }
148 
154  inline std::list<vpMeSite> &getMeList() { return list; }
155  inline std::list<vpMeSite> getMeList() const { return list; }
156 
162  inline int getNbPoints() const { return nGoodElement; }
163 
164 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
165 public:
167  bool display_point; // if 1 (TRUE) displays the line that is being tracked
168 #endif
169 };
170 
171 #endif
void setMeList(const std::list< vpMeSite > &l)
Definition: vpMeTracker.h:147
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:53
int getNbPoints() const
Definition: vpMeTracker.h:162
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
Definition: vpMe.h:60
vpMeSiteDisplayType
Definition: vpMeSite.h:74
Class that defines what is a feature generic tracker.
Definition: vpTracker.h:64
unsigned int getInitRange()
Definition: vpMeTracker.h:126
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
Definition: vpMeTracker.h:102
void setInitRange(const unsigned int &r)
Definition: vpMeTracker.h:119
vpMe * getMe()
Definition: vpMeTracker.h:140
bool display_point
Definition: vpMeTracker.h:167
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:65
std::list< vpMeSite > & getMeList()
Definition: vpMeTracker.h:154
int nGoodElement
Definition: vpMeTracker.h:78
std::list< vpMeSite > getMeList() const
Definition: vpMeTracker.h:155
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:133
vpMeSite::vpMeSiteDisplayType selectDisplay
Definition: vpMeTracker.h:81
unsigned int init_range
Definition: vpMeTracker.h:77