ViSP  2.8.0
vpFeatureLuminance.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureLuminance.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  * Luninance based feature .
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 #ifndef vpFeatureLuminance_h
43 #define vpFeatureLuminance_h
44 
45 #include <visp/vpMatrix.h>
46 #include <visp/vpBasicFeature.h>
47 #include <visp/vpImage.h>
48 
49 
70 class VISP_EXPORT vpLuminance
71 {
72  public:
73  double x, y; // point coordinates (in meter)
74  double I ; // pixel intensity
75  double Ix,Iy ; // pixel gradient
76  double Z; // pixel depth
77 
78 };
79 
80 
92 class VISP_EXPORT vpFeatureLuminance : public vpBasicFeature
93 {
94  protected:
97  double Z ;
98 
100  unsigned int nbr ;
102  unsigned int nbc ;
104  unsigned int bord ;
105 
109 
110  public:
111  void buildFrom(vpImage<unsigned char> &I) ;
112 
113 public:
114 
115  void init() ;
116  void init(unsigned int _nbr, unsigned int _nbc, double _Z) ;
117 
119 
121  virtual ~vpFeatureLuminance() ;
122 
123  public:
125  void setCameraParameters(vpCameraParameters &_cam) ;
126  /*
127  section Set/get Z
128  */
129 
130 
131  void set_Z(const double Z) ;
132  double get_Z() const ;
133 
134 
135  /*
136  vpBasicFeature method instantiation
137  */
138 
139 
140  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
141  void interaction(vpMatrix &L);
142 
143  vpColVector error(const vpBasicFeature &s_star,
144  const unsigned int select = FEATURE_ALL) ;
145  void error(const vpBasicFeature &s_star,
146  vpColVector &e) ;
147 
148  void print(const unsigned int select = FEATURE_ALL ) const ;
149 
150  vpFeatureLuminance *duplicate() const ;
151 
152 
153  void display(const vpCameraParameters &cam,
154  const vpImage<unsigned char> &I,
155  const vpColor &color=vpColor::green, unsigned int thickness=1) const ;
156  void display(const vpCameraParameters &cam,
157  const vpImage<vpRGBa> &I,
158  const vpColor &color=vpColor::green, unsigned int thickness=1) const ;
159 
161  vpColVector error(const unsigned int select = FEATURE_ALL) ;
162 } ;
163 
164 
165 
166 #endif
Class that defines the luminance and gradient of a point.
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
vpLuminance * pixInfo
Store the image (as a vector with intensity and gradient I, Ix, Iy)
unsigned int bord
Border size.
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
unsigned int nbr
Number of rows.
class that defines what is a visual feature
Class that defines the image luminance 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
vpCameraParameters cam
unsigned int nbc
Number of column.
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