ViSP  2.7.0
vpFeaturePoint.h
1 /****************************************************************************
2  *
3  * $Id: vpFeaturePoint.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 point visual feature.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
43 #ifndef vpFeaturePoint_H
44 #define vpFeaturePoint_H
45 
51 #include <visp/vpMatrix.h>
52 #include <visp/vpBasicFeature.h>
53 #include <visp/vpPoint.h>
54 
55 #include <visp/vpHomogeneousMatrix.h>
56 #include <visp/vpRGBa.h>
57 
58 
184 class VISP_EXPORT vpFeaturePoint : public vpBasicFeature
185 {
186 private:
189  double Z ;
190 
191 public:
192 
193  void init() ;
194 
195  vpFeaturePoint() ;
197  virtual ~vpFeaturePoint() { if (flags != NULL) delete [] flags; }
198 
199 
200  /*
201  section Set coordinates
202  */
203 
204  void buildFrom(const double x, const double y, const double Z) ;
205 
206  void set_x(const double x) ;
207 
208  void set_y(const double y) ;
209 
210  void set_Z(const double Z) ;
211 
212  void set_xyZ(const double x, const double y, const double Z) ;
213 
214  double get_x() const ;
215 
216  double get_y() const ;
217 
218  double get_Z() const ;
219 
220 
221  /*
222  vpBasicFeature method instantiation
223  */
224 
225  // feature selection
242  inline static unsigned int selectX() { return FEATURE_LINE[0] ; }
243 
260  inline static unsigned int selectY() { return FEATURE_LINE[1] ; }
261 
262  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
263 
264  vpColVector error(const vpBasicFeature &s_star,
265  const unsigned int select = FEATURE_ALL) ;
266 
267  void print(const unsigned int select = FEATURE_ALL ) const ;
268 
269  vpFeaturePoint *duplicate() const ;
270 
271 
272  void display(const vpCameraParameters &cam,
273  const vpImage<unsigned char> &I,
274  const vpColor &color=vpColor::green,
275  unsigned int thickness=1) const ;
276  void display(const vpCameraParameters &cam,
277  const vpImage<vpRGBa> &I,
278  const vpColor &color=vpColor::green,
279  unsigned int thickness=1) const ;
280 
281 
285  typedef enum
286  {
287  X = 1, // x coordinates
288  Y = 2 // y coordinates
289  } vpFeaturePointType;
291  vpColVector error(const unsigned int select = FEATURE_ALL) ;
292 
293 } ;
294 
295 
296 
297 #endif
298 
299 /*
300  * Local variables:
301  * c-basic-offset: 2
302  * End:
303  */
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:123
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
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:168
class that defines what is a visual feature
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.
virtual void init()=0
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
static unsigned int selectX()
virtual ~vpFeaturePoint()
Destructor.
static unsigned int selectY()