ViSP  2.10.0
vpMbtDistanceCircle.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtDistanceCircle.h 4649 2014-02-07 14:57:11Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 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  * Description:
34  * Manage a circle used in the model-based tracker.
35  *
36  * Authors:
37  * Fabien Spindler
38  *
39  *****************************************************************************/
40 
46 #ifndef vpMbtDistanceCircle_HH
47 #define vpMbtDistanceCircle_HH
48 
49 #include <visp/vpPoint.h>
50 #include <visp/vpMbtMeEllipse.h>
51 #include <visp/vpHomogeneousMatrix.h>
52 #include <visp/vpFeatureEllipse.h>
53 #include <visp/vpCircle.h>
54 #include <visp/vpMbHiddenFaces.h>
55 
63 class VISP_EXPORT vpMbtDistanceCircle
64 {
65  private :
66  std::string name;
67  unsigned int index;
69  vpMe *me;
70  //double alpha;
71  double wmean;
72  vpFeatureEllipse featureEllipse ;
74 // vpMbtPolygon poly;
75 
76  public:
78  vpMbtMeEllipse *meEllipse;
79 
82 
84  double radius;
85 
92 
98  unsigned int nbFeature;
100  bool Reinit;
106  bool isvisible;
107 
108  public:
111 
112  void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, const double r);
113 
114  void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo);
115 
116  void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false);
117  void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false);
118  void displayMovingEdges(const vpImage<unsigned char> &I);
119 
125  inline void getCameraParameters(vpCameraParameters& camera) {camera = this->cam;}
126 
132  inline unsigned int getIndex() {return index ;}
133 
140  inline double getMeanWeight() const {return wmean;}
141 
147  inline std::string getName() const {return name;}
148 
154 // inline vpMbtPolygon& getPolygon() {return poly;}
155 
156  void initInteractionMatrixError();
157 
158  bool initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
159 
165  inline bool isVisible() const {return isvisible; }
166 
167  void reinitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
168 
173  inline void setCameraParameters(const vpCameraParameters& camera) {this->cam = camera;}
174 
180  inline void setIndex(const unsigned int i) {index = i;}
181 
187  inline void setMeanWeight(const double _wmean) {this->wmean = _wmean;}
188 
189  void setMovingEdge(vpMe *Me);
190 
196  inline void setName(const std::string& circle_name) {this->name = circle_name;}
197 
203  inline void setName(const char* circle_name) {this->name = std::string(circle_name);}
204 
210  inline void setVisible(bool _isvisible) {isvisible = _isvisible ;}
211 
212 
213  void trackMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
214 
215  void updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
216 
217  private:
218  void project(const vpHomogeneousMatrix &cMo);
219 } ;
220 
221 #endif
222 
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
unsigned int nbFeature
The number of moving edges.
void setCameraParameters(const vpCameraParameters &camera)
vpPoint * p3
An other point on the plane containing the circle.
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
vpMatrix L
The interaction matrix.
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
vpColVector error
The error vector.
vpMbtMeEllipse * meEllipse
Polygon describing the circle bbox.
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
void getCameraParameters(vpCameraParameters &camera)
int index_polygon
Index of the faces which contain the line.
vpPoint * p2
A point on the plane containing the circle.
Class that defines what is a point.
Definition: vpPoint.h:65
Manage a circle used in the model-based tracker.
bool Reinit
Indicates if the circle has to be reinitialized.
void setName(const char *circle_name)
void setName(const std::string &circle_name)
bool isvisible
Indicates if the circle is visible or not.
Generic class defining intrinsic camera parameters.
void setVisible(bool _isvisible)
vpCircle * circle
The circle to track.
std::string getName() const
double getMeanWeight() const
void setIndex(const unsigned int i)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
void setMeanWeight(const double _wmean)
Class that defines 2D ellipse visual feature.
double radius
The radius of the circle.
Class that defines what is a circle.
Definition: vpCircle.h:61
vpPoint * p1
The center of the circle.