ViSP  2.10.0
vpFeatureVanishingPoint.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureVanishingPoint.h 5237 2015-01-30 13:52:04Z 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  * 2D vanishing point visual feature (Z coordinate in 3D space is infinity)
36  *
37  * Authors:
38  * Odile Bourquardez
39  *
40  *****************************************************************************/
41 
42 
43 #ifndef vpFeatureVanishingPoint_H
44 #define vpFeatureVanishingPoint_H
45 
46 
47 
53 #include <visp/vpMatrix.h>
54 #include <visp/vpBasicFeature.h>
55 #include <visp/vpPoint.h>
56 
57 #include <visp/vpHomogeneousMatrix.h>
58 #include <visp/vpRGBa.h>
59 
60 
61 
69 class VISP_EXPORT vpFeatureVanishingPoint : public vpBasicFeature
70 {
71 public:
72  typedef enum
73  {
74  X = 1, // x coordinates
75  Y = 2 // y coordinates
76  } vpFeatureVanishingPointType;
77 
78  /*
79  attributes and members directly related to the vpBasicFeature needs
80  other functionalities ar useful but not mandatory
81  */
82  //no Z required
83 
84 public:
86  void init() ;
91 
92 
93 public:
94  /*
95  /section Set coordinates
96  */
97 
98 
100  void set_x(const double _x) ;
102  double get_x() const ;
104  void set_y(const double _y) ;
106  double get_y() const ;
108  void set_xy(const double _x, const double _y) ;
109  // void buildFrom(const vpPoint &p) ;
110  void buildFrom(const double _x, const double _y) ;
111 
112 
113 
114  public:
115  /*
116  vpBasicFeature method instantiation
117  */
118  // feature selection
119  inline static unsigned int selectX() { return FEATURE_LINE[0] ; }
120  inline static unsigned int selectY() { return FEATURE_LINE[1] ; }
121 
122 
124  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
127  vpColVector error(const vpBasicFeature &s_star,
128  const unsigned int select = FEATURE_ALL) ;
130  vpColVector error(const unsigned int select = FEATURE_ALL) ;
132  void print(const unsigned int select = FEATURE_ALL ) const ;
133 
136 
137 public:
138  void display(const vpCameraParameters &cam,
139  const vpImage<unsigned char> &I,
140  const vpColor &color=vpColor::green,
141  unsigned int thickness=1) const;
142  void display(const vpCameraParameters &cam,
143  const vpImage<vpRGBa> &I,
144  const vpColor &color=vpColor::green,
145  unsigned int thickness=1) const;
146 
147 } ;
148 
149 
150 
151 #endif
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
virtual ~vpFeatureVanishingPoint()
Destructor.
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
Class that defines 2D vanishing point visual feature (Z coordinate in 3D space is infinity)...
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
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.
static unsigned int selectY()
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 selectX()
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