Visual Servoing Platform  version 3.1.0
vpMe.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  * Eric Marchand
36  * Andrew Comport
37  * Aurelien Yol
38  *
39  *****************************************************************************/
40 
46 #ifndef vpMe_H
47 #define vpMe_H
48 
49 #include <visp3/core/vpImage.h>
50 #include <visp3/core/vpMath.h>
51 #include <visp3/core/vpMatrix.h>
52 
60 class VISP_EXPORT vpMe
61 {
62 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
63 public:
64 #else
65 private:
66 #endif
67  double threshold;
68  double mu1;
69  double mu2;
71  unsigned int anglestep;
72  int mask_sign;
73  unsigned int range;
74  double sample_step;
80  unsigned int mask_size;
84  unsigned int n_mask;
85  // strip: defines a "security strip" such that Seek_Extremities()
86  // cannot return a new extremity which is too close to the
87  // frame borders which may cause Get_Sampling_Grid to refuse
88  // the that extremity
89  int strip;
90  // int graph ;
92 
94 public:
95  vpMe();
96  vpMe(const vpMe &me);
97  virtual ~vpMe();
98 
99  vpMe &operator=(const vpMe &me);
100 #ifdef VISP_HAVE_CPP11_COMPATIBILITY
101  vpMe &operator=(const vpMe &&me);
102 #endif
103 
104  void checkSamplestep(double &a)
105  {
106  if (a < min_samplestep)
107  a = min_samplestep;
108  }
114  inline unsigned int getAngleStep() const { return anglestep; }
120  inline vpMatrix *getMask() const { return mask; }
128  inline unsigned int getMaskNumber() const { return n_mask; }
134  inline int getMaskSign() const { return mask_sign; }
142  inline unsigned int getMaskSize() const { return mask_size; }
149  inline double getMinSampleStep() const { return min_samplestep; }
155  inline double getMu1() const { return mu1; }
161  inline double getMu2() const { return mu2; }
167  inline int getNbTotalSample() const { return ntotal_sample; }
173  inline int getPointsToTrack() const { return points_to_track; }
179  inline unsigned int getRange() const { return range; }
185  inline int getStrip() const { return strip; }
186 
193  inline double getThreshold() const { return threshold; }
194 
195  void initMask(); // convolution masks - offset computation
196  void print();
197 
203  void setAngleStep(const unsigned int &a) { anglestep = a; }
211  void setMaskNumber(const unsigned int &a);
212 
218  void setMaskSign(const int &a) { mask_sign = a; }
219 
227  void setMaskSize(const unsigned int &a);
234  void setMinSampleStep(const double &min) { min_samplestep = min; }
235 
241  void setMu1(const double &mu_1) { this->mu1 = mu_1; }
242 
248  void setMu2(const double &mu_2) { this->mu2 = mu_2; }
249 
255  void setNbTotalSample(const int &nb) { ntotal_sample = nb; }
256 
264  void setPointsToTrack(const int &n) { points_to_track = n; }
265 
271  void setRange(const unsigned int &r) { range = r; }
272 
278  void setSampleStep(const double &s) { sample_step = s; }
279 
285  inline double getSampleStep() const { return sample_step; }
286 
292  void setStrip(const int &a) { strip = a; }
293 
300  void setThreshold(const double &t) { threshold = t; }
301 };
302 
303 #endif
double threshold
Definition: vpMe.h:67
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
void setPointsToTrack(const int &n)
Definition: vpMe.h:264
void setStrip(const int &a)
Definition: vpMe.h:292
vpMatrix * mask
Definition: vpMe.h:91
unsigned int range
Definition: vpMe.h:73
void setSampleStep(const double &s)
Definition: vpMe.h:278
int ntotal_sample
Distance between sampled points (in pixels)
Definition: vpMe.h:75
void setNbTotalSample(const int &nb)
Definition: vpMe.h:255
Definition: vpMe.h:60
int getNbTotalSample() const
Definition: vpMe.h:167
int mask_sign
Definition: vpMe.h:72
vpMatrix * getMask() const
Definition: vpMe.h:120
unsigned int getMaskSize() const
Definition: vpMe.h:142
void setMu1(const double &mu_1)
Definition: vpMe.h:241
double getMu1() const
Definition: vpMe.h:155
unsigned int mask_size
Definition: vpMe.h:80
double getThreshold() const
Definition: vpMe.h:193
double getSampleStep() const
Definition: vpMe.h:285
void setAngleStep(const unsigned int &a)
Definition: vpMe.h:203
int points_to_track
Definition: vpMe.h:76
double getMinSampleStep() const
Definition: vpMe.h:149
unsigned int getMaskNumber() const
Definition: vpMe.h:128
void checkSamplestep(double &a)
Definition: vpMe.h:104
int getStrip() const
Definition: vpMe.h:185
void setMaskSign(const int &a)
Definition: vpMe.h:218
void setMu2(const double &mu_2)
Definition: vpMe.h:248
double min_samplestep
Contrast continuity parameter (right boundary)
Definition: vpMe.h:70
unsigned int n_mask
Definition: vpMe.h:84
int strip
Definition: vpMe.h:89
double mu1
Likelihood ratio threshold.
Definition: vpMe.h:68
void setThreshold(const double &t)
Definition: vpMe.h:300
double getMu2() const
Definition: vpMe.h:161
double mu2
Contrast continuity parameter (left boundary)
Definition: vpMe.h:69
unsigned int anglestep
Definition: vpMe.h:71
int getPointsToTrack() const
Definition: vpMe.h:173
void setRange(const unsigned int &r)
Definition: vpMe.h:271
double sample_step
Seek range - on both sides of the reference pixel.
Definition: vpMe.h:74
unsigned int getRange() const
Definition: vpMe.h:179
int getMaskSign() const
Definition: vpMe.h:134
void setMinSampleStep(const double &min)
Definition: vpMe.h:234
unsigned int getAngleStep() const
Definition: vpMe.h:114