ViSP  2.8.0
vpMbtMeLine.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtMeLine.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Implementation of a line used by the model-based tracker.
36  *
37  * Authors:
38  * Nicolas Melchior
39  * Romain Tallonneau
40  * Eric Marchand
41  *
42  *****************************************************************************/
43 
49 #ifndef vpMbtMeLine_HH
50 #define vpMbtMeLine_HH
51 
52 #include <visp/vpPoint.h>
53 #include <visp/vpMe.h>
54 #include <visp/vpMeTracker.h>
55 
62 class VISP_EXPORT vpMbtMeLine : public vpMeTracker
63 {
64  private:
65  vpMeSite PExt[2] ;
66  double rho, theta, theta_1;
67  double delta ,delta_1;
68  int sign;
69  double a,b,c;
70 
71  public:
72  int imin, imax;
73  int jmin, jmax;
75 
76  public:
77  vpMbtMeLine();
78  ~vpMbtMeLine();
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
125 
void display(const vpImage< unsigned char > &I)
Definition: vpMbtMeLine.h:81
double get_a() const
Definition: vpMbtMeLine.h:88
double get_c() const
Definition: vpMbtMeLine.h:102
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
Definition: vpMeSite.h:76
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
virtual void sample(const vpImage< unsigned char > &image)=0
Sample pixels at a given interval.
Implementation of a line used by the model-based tracker.
Definition: vpMbtMeLine.h:62
void display(const vpImage< unsigned char > &, vpColor)
Definition: vpMbtMeLine.h:80
double expecteddensity
Definition: vpMbtMeLine.h:74
void track(const vpImage< unsigned char > &I)
Track sampled pixels.
Contains abstract elements for a Distance to Feature type feature.
Definition: vpMeTracker.h:71
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:92
virtual void display(const vpImage< unsigned char > &I, vpColor col)=0
double get_b() const
Definition: vpMbtMeLine.h:95