Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Implementation of a line used by the model-based tracker.
32  *
33  * Authors:
34  * Nicolas Melchior
35  * Romain Tallonneau
36  * Eric Marchand
37  *
38  *****************************************************************************/
39 
45 #ifndef vpMbtMeLine_HH
46 #define vpMbtMeLine_HH
47 
48 #include <visp3/core/vpPoint.h>
49 #include <visp3/me/vpMe.h>
50 #include <visp3/me/vpMeTracker.h>
51 
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53 
60 class VISP_EXPORT vpMbtMeLine : public vpMeTracker
61 {
62  private:
63  vpMeSite PExt[2] ;
64  double rho, theta, theta_1;
65  double delta ,delta_1;
66  int sign;
67  double a,b,c;
68 
69  public:
70  int imin, imax;
71  int jmin, jmax;
72  double expecteddensity;
73 
74  public:
75  vpMbtMeLine();
76  ~vpMbtMeLine();
77 
78  void computeProjectionError(const vpImage<unsigned char>& _I, double &_sumErrorRad, unsigned int &_nbFeatures);
79 
80  void display(const vpImage<unsigned char>& /*I*/, vpColor /*col*/) {;}
81  void display(const vpImage<unsigned char>& I) {vpMeTracker::display(I);} //Shouldn't be here since it's already in vpMeTracker
82 
88  inline double get_a() const { return this->a;}
89 
95  inline double get_b() const { return this->b;}
96 
102  inline double get_c() const { return this->c;}
103 
104  void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho, double theta);
105 
106  void track(const vpImage<unsigned char> &I);
107 
108  void updateParameters(const vpImage<unsigned char> &I, double rho, double theta);
109  void updateParameters(const vpImage<unsigned char> &I, vpImagePoint ip1, vpImagePoint ip2, double rho, double theta);
110 
111  private:
112  void bubbleSortI();
113  void bubbleSortJ();
114  void findSignal(const vpImage<unsigned char>& I, const vpMe *me, double *conv);
115  void sample(const vpImage<unsigned char>&image);
116  void seekExtremities(const vpImage<unsigned char> &I);
117  void setExtremities();
118  void suppressPoints(const vpImage<unsigned char> &I);
119  void reSample(const vpImage<unsigned char>&image);
120  void reSample(const vpImage<unsigned char>&image, vpImagePoint ip1, vpImagePoint ip2);
121  void updateDelta();
122 } ;
123 
124 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
125 
126 #endif
127 
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
Definition: vpMeSite.h:72
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
Definition: vpMe.h:59
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:64
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