ViSP  2.9.0
vpFeatureThetaU.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureThetaU.h 4574 2014-01-09 08:48:51Z 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  *
34  * Description:
35  * ThetaU visual feature.
36  *
37  * Authors:
38  * Eric Marchand
39  * Fabien Spindler
40  *
41  *****************************************************************************/
42 
43 
44 #ifndef vpFeatureThetaU_H
45 #define vpFeatureThetaU_H
46 
52 #include <visp/vpMatrix.h>
53 #include <visp/vpThetaUVector.h>
54 #include <visp/vpBasicFeature.h>
55 
56 #include <visp/vpHomogeneousMatrix.h>
57 #include <visp/vpRGBa.h>
58 
59 
229 class VISP_EXPORT vpFeatureThetaU : public vpBasicFeature
230 {
231 public:
232  typedef enum
233  {
234  TUx = 1,
236  TUy = 2,
238  TUz = 4
240  } vpFeatureThetaUType;
241  typedef enum
242  {
243  cdRc,
247  cRcd
251  } vpFeatureThetaURotationRepresentationType;
252  /*
253  attributes and members directly related to the vpBasicFeature needs
254  other functionalities are useful but not mandatory
255  */
256 
257 public:
258  // Basic construction.
259  void init() ;
260  // Basic constructor.
261  vpFeatureThetaU(vpFeatureThetaURotationRepresentationType r) ;
263  vpFeatureThetaURotationRepresentationType r) ;
265  vpFeatureThetaURotationRepresentationType r) ;
267  vpFeatureThetaURotationRepresentationType r) ;
268  void buildFrom(vpThetaUVector &tu) ;
269  // build from a rotation matrix
270  void buildFrom(const vpRotationMatrix &R) ;
271  // build from an homogeneous matrix
272  void buildFrom(const vpHomogeneousMatrix &M) ;
273 
274 
276  virtual ~vpFeatureThetaU() { if (flags != NULL) delete [] flags; /*vpTRACE("0x%x", this)*/ ;}
277 
278 public:
279 
280 
281  void set_TUx(const double tu_x) ;
282  void set_TUy(const double tu_y) ;
283  void set_TUz(const double tu_z) ;
284 
285  double get_TUx() const ;
286  double get_TUy() const ;
287  double get_TUz() const ;
288 
289 
290 public:
291  /*
292  vpBasicFeature method instantiation
293  */
294 
319  inline static unsigned int selectTUx() { return FEATURE_LINE[0] ; }
344  inline static unsigned int selectTUy() { return FEATURE_LINE[1] ; }
369  inline static unsigned int selectTUz() { return FEATURE_LINE[2] ; }
370  // compute the interaction matrix from a subset a the possible features
371  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
372  // compute the error between two visual features from a subset
373  // a the possible features
374  vpColVector error(const vpBasicFeature &s_star,
375  const unsigned int select = FEATURE_ALL) ;
376  void print(const unsigned int select= FEATURE_ALL) const ;
377 
379  vpFeatureThetaU *duplicate() const ;
380 
381 public:
382  void display(const vpCameraParameters &cam,
383  const vpImage<unsigned char> &I,
384  const vpColor &color=vpColor::green,
385  unsigned int thickness=1) const ;
386  void display(const vpCameraParameters &cam,
387  const vpImage<vpRGBa> &I,
388  const vpColor &color=vpColor::green,
389  unsigned int thickness=1) const ;
390 
391  private:
392  vpFeatureThetaURotationRepresentationType rotation;
393 } ;
394 
395 
396 #endif
397 
398 /*
399  * Local variables:
400  * c-basic-offset: 2
401  * End:
402  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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
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
The vpRotationMatrix considers the particular case of a rotation matrix.
class that defines what is a visual feature
static unsigned int selectTUz()
static unsigned int selectTUx()
virtual vpMatrix interaction(const unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
static unsigned int selectTUy()
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
Class that defines a 3D visual feature from a axis/angle parametrization that represent the rotatio...
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
Class that consider the case of the parameterization for the rotation.
virtual ~vpFeatureThetaU()
Destructor. Does nothing.