Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpFeatureMomentCInvariant.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Implementation for all supported moment features.
32  *
33  * Authors:
34  * Filip Novotny
35  *
36  *****************************************************************************/
41 #ifndef __FEATUREMOMENTCINVARIANT_H__
42 #define __FEATUREMOMENTCINVARIANT_H__
43 #include <visp3/visual_features/vpFeatureMoment.h>
44 #ifdef VISP_MOMENTS_COMBINE_MATRICES
45 
78 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment{
79  public:
89  vpFeatureMomentCInvariant(vpMomentDatabase& moments,double A, double B, double C,vpFeatureMomentDatabase* featureMoments=NULL) :
90  vpFeatureMoment(moments,A,B,C,featureMoments,16){}
91  void compute_interaction();
95  const char* momentName() const { return "vpMomentCInvariant";}
99  const char* name() const { return "vpFeatureMomentCInvariant";}
100 
104  static unsigned int selectC1(){ return 1 << 0; }
108  static unsigned int selectC2(){ return 1 << 1; }
112  static unsigned int selectC3(){ return 1 << 2; }
116  static unsigned int selectC4(){ return 1 << 3; }
120  static unsigned int selectC5(){ return 1 << 4; }
124  static unsigned int selectC6(){ return 1 << 5; }
128  static unsigned int selectC7(){ return 1 << 6; }
132  static unsigned int selectC8(){ return 1 << 7; }
136  static unsigned int selectC9(){ return 1 << 8; }
140  static unsigned int selectC10(){ return 1 << 9; }
144  static unsigned int selectSx(){ return 1 << 10; }
148  static unsigned int selectSy(){ return 1 << 11; }
152  static unsigned int selectPx(){ return 1 << 12; }
156  static unsigned int selectPy(){ return 1 << 13; }
157 
158 };
159 
160 #else
161 class vpMomentDatabase;
162 
196 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment{
197  private:
198  std::vector<vpMatrix> LI;
199  public:
209  vpFeatureMomentCInvariant(vpMomentDatabase& data_base,double A_, double B_, double C_, vpFeatureMomentDatabase* featureMoments=NULL)
210  : vpFeatureMoment(data_base,A_,B_,C_,featureMoments,16), LI(16)
211  {}
212 
213  void compute_interaction();
217  const char* momentName() const { return "vpMomentCInvariant";}
221  const char* name() const { return "vpFeatureMomentCInvariant";}
222 
226  static unsigned int selectC1(){ return 1 << 0; }
230  static unsigned int selectC2(){ return 1 << 1; }
234  static unsigned int selectC3(){ return 1 << 2; }
238  static unsigned int selectC4(){ return 1 << 3; }
242  static unsigned int selectC5(){ return 1 << 4; }
246  static unsigned int selectC6(){ return 1 << 5; }
250  static unsigned int selectC7(){ return 1 << 6; }
254  static unsigned int selectC8(){ return 1 << 7; }
258  static unsigned int selectC9(){ return 1 << 8; }
262  static unsigned int selectC10(){ return 1 << 9; }
266  static unsigned int selectSx(){ return 1 << 10; }
270  static unsigned int selectSy(){ return 1 << 11; }
274  static unsigned int selectPx(){ return 1 << 12; }
278  static unsigned int selectPy(){ return 1 << 13; }
279 
283  void printLsofInvariants(std::ostream& os) const;
284 
285  friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpFeatureMomentCInvariant& featcinv);
286 
287 };
288 #endif
289 #endif
virtual const char * name() const =0
virtual void compute_interaction(void)
virtual const char * momentName() const =0
This class allows to register all vpMoments so they can access each other according to their dependen...
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpFeatureMoment &featM)
This class defines shared system methods/attributes for 2D moment features but no functional code...
vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_, vpFeatureMomentDatabase *featureMoments=NULL)
Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature...
This class allows to register all feature moments (implemented in vpFeatureMoment... classes) so they can access each other according to their dependencies.