ViSP  2.6.2
vpMbtMeLine.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtMeLine.h 3672 2012-04-04 15:49:57Z ayol $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 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  * Make the complete tracking of an object by using its CAD model
36  *
37  * Authors:
38  * Nicolas Melchior
39  * Romain Tallonneau
40  * Eric Marchand
41  *
42  *****************************************************************************/
43 
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 
51 #ifndef vpMbtMeLine_HH
52 #define vpMbtMeLine_HH
53 
54 #include <visp/vpPoint.h>
55 #include <visp/vpMe.h>
56 #include <visp/vpMeTracker.h>
57 
64 class VISP_EXPORT vpMbtMeLine : public vpMeTracker
65 {
66  private:
67  vpMeSite PExt[2] ;
68  double rho, theta, theta_1;
69  double delta ,delta_1;
70  int sign;
71  double a,b,c;
72 
73  public:
74  int imin, imax;
75  int jmin, jmax;
76  double expecteddensity;
77 
78  public:
79  vpMbtMeLine();
80  ~vpMbtMeLine();
81  void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho, double theta);
82  void track(const vpImage<unsigned char> &I);
83  void updateParameters(const vpImage<unsigned char> &I, double rho, double theta);
84  void updateParameters(const vpImage<unsigned char> &I, vpImagePoint ip1, vpImagePoint ip2, double rho, double theta);
85  void display(const vpImage<unsigned char>& /*I*/, vpColor /*col*/) {;}
86  void display(const vpImage<unsigned char>& I) {vpMeTracker::display(I);} //Shouldn't be here since it's already in vpMeTracker
87 
93  inline double get_a() const { return this->a;}
94 
100  inline double get_b() const { return this->b;}
101 
107  inline double get_c() const { return this->c;}
108 
109  private:
110  void sample(const vpImage<unsigned char>&image);
111  void reSample(const vpImage<unsigned char>&image);
112  void reSample(const vpImage<unsigned char>&image, vpImagePoint ip1, vpImagePoint ip2);
113  void updateDelta();
114  void bubbleSortI();
115  void bubbleSortJ();
116  void suppressPoints(const vpImage<unsigned char> &I);
117  void setExtremities();
118  void seekExtremities(const vpImage<unsigned char> &I);
119  void findSignal(const vpImage<unsigned char>& I, const vpMe *me, double *conv);
120 } ;
121 
122 #endif
123 #endif
124 
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:123
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.
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