ViSP  2.8.0
vpFeatureTranslation.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureTranslation.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  * 3D translation visual feature.
36  *
37  * Authors:
38  * Eric Marchand
39  * Fabien Spindler
40  *
41  *****************************************************************************/
42 
43 
44 #ifndef vpFeatureTranslation_H
45 #define vpFeatureTranslation_H
46 
52 #include <visp/vpMatrix.h>
53 #include <visp/vpBasicFeature.h>
54 #include <visp/vpTranslationVector.h>
55 #include <visp/vpHomogeneousMatrix.h>
56 #include <visp/vpRGBa.h>
57 
58 
278 class VISP_EXPORT vpFeatureTranslation : public vpBasicFeature
279 {
280 public:
281 
286  typedef enum {
298  cMo
299  } vpFeatureTranslationRepresentationType;
300 
301  // basic construction
302  void init() ;
303  // basic constructor
304  vpFeatureTranslation(vpFeatureTranslationRepresentationType r) ;
305  // constructor : build from an homogeneous matrix
306  // cdMc is the displacement that the camera has to realize
307  vpFeatureTranslation(vpHomogeneousMatrix &f2Mf1, vpFeatureTranslationRepresentationType r) ;
309  virtual ~vpFeatureTranslation() { if (flags != NULL) delete [] flags; }
310 
311  // build from an homogeneous matrix
312  // cdMc is the displacement that the camera has to realize
313  void buildFrom(const vpHomogeneousMatrix &f2Mf1) ;
314 
315  void set_Tx(const double t_x) ;
316  void set_Ty(const double t_y) ;
317  void set_Tz(const double t_z) ;
318 
319  double get_Tx() const ;
320  double get_Ty() const ;
321  double get_Tz() const ;
322 
323 
324  // feature selection
369  inline static unsigned int selectTx() { return FEATURE_LINE[0] ; }
413  inline static unsigned int selectTy() { return FEATURE_LINE[1] ; }
457  inline static unsigned int selectTz() { return FEATURE_LINE[2] ; }
458  // compute the interaction matrix from a subset a the possible features
459  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
460  // compute the error between two visual features from a subset
461  // a the possible features
462  vpColVector error(const vpBasicFeature &s_star,
463  const unsigned int select = FEATURE_ALL) ;
464  // print the name of the feature
465  void print(const unsigned int select= FEATURE_ALL) const ;
466 
467 
470 
471 
472  void display(const vpCameraParameters &cam,
473  const vpImage<unsigned char> &I,
474  const vpColor &color=vpColor::green,
475  unsigned int thickness=1) const ;
476  void display(const vpCameraParameters &cam,
477  const vpImage<vpRGBa> &I,
478  const vpColor &color=vpColor::green,
479  unsigned int thickness=1) const ;
480 
481 private:
483  vpHomogeneousMatrix f2Mf1;
484  vpFeatureTranslationRepresentationType translation;
485 } ;
486 
487 
488 #endif
489 
490 /*
491  * Local variables:
492  * c-basic-offset: 2
493  * End:
494  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
Class that defines the translation visual feature .
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 unsigned int selectTy()
static const vpColor green
Definition: vpColor.h:170
class that defines what is a visual feature
static unsigned int selectTz()
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
static unsigned int selectTx()
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
virtual ~vpFeatureTranslation()
Destructor. Does nothing.