ViSP  2.8.0
vpMomentCInvariant.h
1 /****************************************************************************
2  *
3  * $Id: vpMomentCInvariant.h 4276 2013-06-25 12:36:48Z 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  * Descriptor for various invariants used to drive space roations around X and Y axis.
36  *
37  * Authors:
38  * Filip Novotny
39  *
40  *****************************************************************************/
45 #ifndef __MOMENTCINVARIANT_H__
46 #define __MOMENTCINVARIANT_H__
47 
48 #include <visp/vpMoment.h>
49 #include <visp/vpMomentDatabase.h>
50 
51 class vpMomentCentered;
52 class vpMomentBasic;
53 
118 class VISP_EXPORT vpMomentCInvariant : public vpMoment {
119  private:
120  std::vector<double> I;
121  std::vector<double> II;
122  std::vector<double> c;
123  std::vector<double> s;
124  double K;
125 
126  void computeI(vpMomentCentered& momentCentered, std::vector<double>& I);
127  public:
128 
130 
134  double C1(){ return values[0]; }
138  double C2(){ return values[1]; }
142  double C3(){ return values[2]; }
146  double C4(){ return values[3]; }
150  double C5(){ return values[4]; }
154  double C6(){ return values[5]; }
158  double C7(){ return values[6]; }
162  double C8(){ return values[7]; }
166  double C9(){ return values[8]; }
170  double C10(){ return values[9]; }
171 
172  void compute();
173 
178  double get(unsigned int i){ return values[i]; }
179 
183  double getC(unsigned int i){return c[i];}
187  double getI(unsigned int index){return I[index];}
188 
192  double getII(unsigned int i){return II[i];}
196  double getK(){return K;}
197 
201  double getS(unsigned int i){return s[i];}
202 
206  const char* name(){return "vpMomentCInvariant";}
207 
211  void printI(unsigned int index);
212 
216  double Px(){ return values[12]; }
220  double Py(){ return values[13]; }
221 
225  double Sx(){ return values[10]; }
229  double Sy(){ return values[11]; }
230 
231  friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMomentCInvariant& v);
232 };
233 
234 #endif
This class defines the 2D basic moment . This class is a wrapper for vpMomentObject wich allows to us...
Definition: vpMomentBasic.h:74
double getII(unsigned int i)
This class defines shared methods/attributes for 2D moments.
Definition: vpMoment.h:104
double getS(unsigned int i)
This class defines the double-indexed centered moment descriptor .
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpMoment &m)
Definition: vpMoment.cpp:126
double getC(unsigned int i)
double getI(unsigned int index)
This class defines several 2D (translation+rotation+scale) invariants for both symmetric and non-symm...
virtual void compute()=0