ViSP  2.6.2
vpMomentCInvariant.h
1 /****************************************************************************
2  *
3  * $Id: vpMomentCInvariant.h 3530 2012-01-03 10:52:12Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 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 
120 class VISP_EXPORT vpMomentCInvariant : public vpMoment {
121  private:
122  std::vector<double> I;
123  std::vector<double> II;
124  std::vector<double> c;
125  std::vector<double> s;
126  double K;
127 
128  void computeI(vpMomentCentered& momentCentered, std::vector<double>& I);
129  public:
130 
132 
136  double C1(){ return values[0]; }
140  double C2(){ return values[1]; }
144  double C3(){ return values[2]; }
148  double C4(){ return values[3]; }
152  double C5(){ return values[4]; }
156  double C6(){ return values[5]; }
160  double C7(){ return values[6]; }
164  double C8(){ return values[7]; }
168  double C9(){ return values[8]; }
172  double C10(){ return values[9]; }
173 
174  void compute();
175 
180  double get(unsigned int i){ return values[i]; }
181 
185  double getC(unsigned int i){return c[i];}
189  double getI(unsigned int index){return I[index];}
190 
194  double getII(unsigned int i){return II[i];}
198  double getK(){return K;}
199 
203  double getS(unsigned int i){return s[i];}
204 
208  const char* name(){return "vpMomentCInvariant";}
209 
213  void printI(unsigned int index);
214 
218  double Px(){ return values[12]; }
222  double Py(){ return values[13]; }
223 
227  double Sx(){ return values[10]; }
231  double Sy(){ return values[11]; }
232 
233  friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMomentCInvariant& v);
234 };
235 
236 #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