ViSP  2.9.0
vpFeatureLuminance.h
1 /****************************************************************************
2  *
3  * $Id: vpFeatureLuminance.h 4664 2014-02-16 16:17:54Z 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  * 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 
66 class VISP_EXPORT vpLuminance
67 {
68  public:
69  double x, y; // point coordinates (in meter)
70  double I ; // pixel intensity
71  double Ix,Iy ; // pixel gradient
72  double Z; // pixel depth
73 
74 };
75 
76 
84 class VISP_EXPORT vpFeatureLuminance : public vpBasicFeature
85 {
86  protected:
89  double Z ;
90 
92  unsigned int nbr ;
94  unsigned int nbc ;
96  unsigned int bord ;
97 
101 
102  public:
103  void buildFrom(vpImage<unsigned char> &I) ;
104 
105 public:
106 
107  void init() ;
108  void init(unsigned int _nbr, unsigned int _nbc, double _Z) ;
109 
113 
115  virtual ~vpFeatureLuminance() ;
116 
117  public:
119  void setCameraParameters(vpCameraParameters &_cam) ;
120  /*
121  section Set/get Z
122  */
123 
124 
125  void set_Z(const double Z) ;
126  double get_Z() const ;
127 
128 
129  /*
130  vpBasicFeature method instantiation
131  */
132 
133 
134  vpMatrix interaction(const unsigned int select = FEATURE_ALL);
135  void interaction(vpMatrix &L);
136 
137  vpColVector error(const vpBasicFeature &s_star,
138  const unsigned int select = FEATURE_ALL) ;
139  void error(const vpBasicFeature &s_star,
140  vpColVector &e) ;
141 
142  void print(const unsigned int select = FEATURE_ALL ) const ;
143 
144  vpFeatureLuminance *duplicate() const ;
145 
146 
147  void display(const vpCameraParameters &cam,
148  const vpImage<unsigned char> &I,
149  const vpColor &color=vpColor::green, unsigned int thickness=1) const ;
150  void display(const vpCameraParameters &cam,
151  const vpImage<vpRGBa> &I,
152  const vpColor &color=vpColor::green, unsigned int thickness=1) const ;
153 
155  vpColVector error(const unsigned int select = FEATURE_ALL) ;
156 } ;
157 
158 
159 
160 #endif
vpBasicFeature & operator=(const vpBasicFeature &f)
Class that defines the luminance and gradient of a point.
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
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