Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
vpFeatureMomentCInvariant.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Implementation for all supported moment features.
33  *
34  * Authors:
35  * Filip Novotny
36  *
37  *****************************************************************************/
43 #ifndef _vpFeatureMomentCInvariant_h_
44 #define _vpFeatureMomentCInvariant_h_
45 
46 #include <visp3/visual_features/vpFeatureMoment.h>
47 
48 #ifdef VISP_MOMENTS_COMBINE_MATRICES
49 
95 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
96 {
97 public:
110  vpFeatureMomentCInvariant(vpMomentDatabase &moments, double A, double B, double C,
111  vpFeatureMomentDatabase *featureMoments = NULL)
112  : vpFeatureMoment(moments, A, B, C, featureMoments, 16)
113  {
114  }
115  void compute_interaction();
119  const char *momentName() const { return "vpMomentCInvariant"; }
123  const char *name() const { return "vpFeatureMomentCInvariant"; }
124 
128  static unsigned int selectC1() { return 1 << 0; }
132  static unsigned int selectC2() { return 1 << 1; }
136  static unsigned int selectC3() { return 1 << 2; }
140  static unsigned int selectC4() { return 1 << 3; }
144  static unsigned int selectC5() { return 1 << 4; }
148  static unsigned int selectC6() { return 1 << 5; }
152  static unsigned int selectC7() { return 1 << 6; }
156  static unsigned int selectC8() { return 1 << 7; }
160  static unsigned int selectC9() { return 1 << 8; }
164  static unsigned int selectC10() { return 1 << 9; }
168  static unsigned int selectSx() { return 1 << 10; }
172  static unsigned int selectSy() { return 1 << 11; }
176  static unsigned int selectPx() { return 1 << 12; }
180  static unsigned int selectPy() { return 1 << 13; }
181 };
182 
183 #else
184 class vpMomentDatabase;
185 
232 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
233 {
234 private:
235  std::vector<vpMatrix> LI;
236 
237 public:
250  vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_,
251  vpFeatureMomentDatabase *featureMoments = NULL)
252  : vpFeatureMoment(data_base, A_, B_, C_, featureMoments, 16), LI(16)
253  {
254  }
255 
256  void compute_interaction();
260  const char *momentName() const { return "vpMomentCInvariant"; }
264  const char *name() const { return "vpFeatureMomentCInvariant"; }
265 
269  static unsigned int selectC1() { return 1 << 0; }
273  static unsigned int selectC2() { return 1 << 1; }
277  static unsigned int selectC3() { return 1 << 2; }
281  static unsigned int selectC4() { return 1 << 3; }
285  static unsigned int selectC5() { return 1 << 4; }
289  static unsigned int selectC6() { return 1 << 5; }
293  static unsigned int selectC7() { return 1 << 6; }
297  static unsigned int selectC8() { return 1 << 7; }
301  static unsigned int selectC9() { return 1 << 8; }
305  static unsigned int selectC10() { return 1 << 9; }
309  static unsigned int selectSx() { return 1 << 10; }
313  static unsigned int selectSy() { return 1 << 11; }
317  static unsigned int selectPx() { return 1 << 12; }
321  static unsigned int selectPy() { return 1 << 13; }
322 
326  void printLsofInvariants(std::ostream &os) const;
327 
328  friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpFeatureMomentCInvariant &featcinv);
329 };
330 #endif
331 #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.