Visual Servoing Platform  version 3.1.0
vpMbtMeLine.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  * Implementation of a line used by the model-based tracker.
33  *
34  * Authors:
35  * Nicolas Melchior
36  * Romain Tallonneau
37  * Eric Marchand
38  *
39  *****************************************************************************/
40 
46 #ifndef vpMbtMeLine_HH
47 #define vpMbtMeLine_HH
48 
49 #include <visp3/core/vpPoint.h>
50 #include <visp3/me/vpMe.h>
51 #include <visp3/me/vpMeTracker.h>
52 
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 
61 class VISP_EXPORT vpMbtMeLine : public vpMeTracker
62 {
63 private:
64  vpMeSite PExt[2];
65  double rho, theta, theta_1;
66  double delta, delta_1;
67  int sign;
68  double a, b, c;
69 
70 public:
71  int imin, imax;
72  int jmin, jmax;
73  double expecteddensity;
74 
75 public:
76  vpMbtMeLine();
77  ~vpMbtMeLine();
78 
79  void computeProjectionError(const vpImage<unsigned char> &_I, double &_sumErrorRad, unsigned int &_nbFeatures);
80 
81  void display(const vpImage<unsigned char> & /*I*/, vpColor /*col*/) { ; }
82  void display(const vpImage<unsigned char> &I)
83  {
85  } // Shouldn't be here since it's already in vpMeTracker
86 
93  inline double get_a() const { return this->a; }
94 
101  inline double get_b() const { return this->b; }
102 
109  inline double get_c() const { return this->c; }
110 
111  void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
112  double theta);
113 
114  void track(const vpImage<unsigned char> &I);
115 
116  void updateParameters(const vpImage<unsigned char> &I, double rho, double theta);
117  void updateParameters(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
118  double theta);
119 
120 private:
121  void bubbleSortI();
122  void bubbleSortJ();
123  void sample(const vpImage<unsigned char> &image);
124  void seekExtremities(const vpImage<unsigned char> &I);
125  void setExtremities();
126  void suppressPoints(const vpImage<unsigned char> &I);
127  void reSample(const vpImage<unsigned char> &image);
128  void reSample(const vpImage<unsigned char> &image, const vpImagePoint &ip1, const vpImagePoint &ip2);
129  void updateDelta();
130 };
131 
132 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
133 
134 #endif
Performs search in a given direction(normal) for a given distance(pixels) for a given &#39;site&#39;...
Definition: vpMeSite.h:71
Class to define colors available for display functionnalities.
Definition: vpColor.h:120
virtual void sample(const vpImage< unsigned char > &image)=0
Sample pixels at a given interval.
void track(const vpImage< unsigned char > &I)
Track sampled pixels.
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:65
void initTracking(const vpImage< unsigned char > &I)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
virtual void display(const vpImage< unsigned char > &I, vpColor col)=0