ViSP  2.8.0
vpFeatureLine.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureLine.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  * 2D line visual feature.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
43 #ifndef vpFeatureLine_H
44 #define vpFeatureLine_H
45 
51 #include <visp/vpMatrix.h>
52 #include <visp/vpBasicFeature.h>
53 
54 
55 #include <visp/vpHomogeneousMatrix.h>
56 #include <visp/vpRGBa.h>
57 
58 
201 class VISP_EXPORT vpFeatureLine : public vpBasicFeature
202 {
207 private:
210  double A,B,C,D ;
211 
212 public:
213 
214  void init() ;
215  vpFeatureLine() ;
216  virtual ~vpFeatureLine() { if (flags != NULL) delete [] flags; }
217 
218 public:
219 
220  void setRhoTheta(const double rho, const double theta) ;
221  void setABCD(const double A, const double B,
222  const double C, const double D) ;
223 
224  // void buildFrom(const vpLine &l) ;
225  // void buildFrom(const vpCylinder &c, const int l) ;
226  void buildFrom(const double rho, const double theta) ;
227  void buildFrom(const double rho, const double theta,
228  const double A, const double B,
229  const double C, const double D) ;
230 
231 
235  double getRho() const { return s[0] ; }
236 
240  double getTheta() const { return s[1] ; }
241 
242 
243 public:
244 
261  inline static unsigned int selectRho() { return FEATURE_LINE[0] ; }
262 
279  inline static unsigned int selectTheta() { return FEATURE_LINE[1] ; }
280 
281  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
282 
283  vpColVector error(const vpBasicFeature &s_star,
284  const unsigned int select = FEATURE_ALL) ;
285 
286  //vpColVector error(const int select = FEATURE_ALL) ;
287 
288  void print(const unsigned int select= FEATURE_ALL) const ;
289 
290  vpFeatureLine *duplicate() const ;
291 
292 
293 public:
294  void display(const vpCameraParameters &cam,
295  const vpImage<unsigned char> &I,
296  const vpColor &color=vpColor::green,
297  unsigned int thickness=1) const ;
298  void display(const vpCameraParameters &cam,
299  const vpImage<vpRGBa> &I,
300  const vpColor &color=vpColor::green,
301  unsigned int thickness=1) const ;
302 
303 } ;
304 
305 
306 
307 #endif
308 
309 /*
310  * Local variables:
311  * c-basic-offset: 2
312  * End:
313  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
virtual void print(const unsigned int select=FEATURE_ALL) const =0
Print the name of the feature.
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
double getRho() const
virtual vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
Compute the error between two visual features from a subset of the possible features.
static const vpColor green
Definition: vpColor.h:170
double getTheta() const
static unsigned int selectTheta()
class that defines what is a visual feature
static unsigned int selectRho()
virtual vpMatrix interaction(const unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
Generic class defining intrinsic camera parameters.
Class that defines a 2D line visual feature which is composed by two parameters that are and ...
virtual void init()=0
virtual ~vpFeatureLine()
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
virtual vpBasicFeature * duplicate() const =0
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0