Visual Servoing Platform  version 3.1.0
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 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 __FEATUREMOMENTCINVARIANT_H__
44 #define __FEATUREMOMENTCINVARIANT_H__
45 #include <visp3/visual_features/vpFeatureMoment.h>
46 #ifdef VISP_MOMENTS_COMBINE_MATRICES
47 
93 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
94 {
95 public:
108  vpFeatureMomentCInvariant(vpMomentDatabase &moments, double A, double B, double C,
109  vpFeatureMomentDatabase *featureMoments = NULL)
110  : vpFeatureMoment(moments, A, B, C, featureMoments, 16)
111  {
112  }
113  void compute_interaction();
117  const char *momentName() const { return "vpMomentCInvariant"; }
121  const char *name() const { return "vpFeatureMomentCInvariant"; }
122 
126  static unsigned int selectC1() { return 1 << 0; }
130  static unsigned int selectC2() { return 1 << 1; }
134  static unsigned int selectC3() { return 1 << 2; }
138  static unsigned int selectC4() { return 1 << 3; }
142  static unsigned int selectC5() { return 1 << 4; }
146  static unsigned int selectC6() { return 1 << 5; }
150  static unsigned int selectC7() { return 1 << 6; }
154  static unsigned int selectC8() { return 1 << 7; }
158  static unsigned int selectC9() { return 1 << 8; }
162  static unsigned int selectC10() { return 1 << 9; }
166  static unsigned int selectSx() { return 1 << 10; }
170  static unsigned int selectSy() { return 1 << 11; }
174  static unsigned int selectPx() { return 1 << 12; }
178  static unsigned int selectPy() { return 1 << 13; }
179 };
180 
181 #else
182 class vpMomentDatabase;
183 
230 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
231 {
232 private:
233  std::vector<vpMatrix> LI;
234 
235 public:
248  vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_,
249  vpFeatureMomentDatabase *featureMoments = NULL)
250  : vpFeatureMoment(data_base, A_, B_, C_, featureMoments, 16), LI(16)
251  {
252  }
253 
254  void compute_interaction();
258  const char *momentName() const { return "vpMomentCInvariant"; }
262  const char *name() const { return "vpFeatureMomentCInvariant"; }
263 
267  static unsigned int selectC1() { return 1 << 0; }
271  static unsigned int selectC2() { return 1 << 1; }
275  static unsigned int selectC3() { return 1 << 2; }
279  static unsigned int selectC4() { return 1 << 3; }
283  static unsigned int selectC5() { return 1 << 4; }
287  static unsigned int selectC6() { return 1 << 5; }
291  static unsigned int selectC7() { return 1 << 6; }
295  static unsigned int selectC8() { return 1 << 7; }
299  static unsigned int selectC9() { return 1 << 8; }
303  static unsigned int selectC10() { return 1 << 9; }
307  static unsigned int selectSx() { return 1 << 10; }
311  static unsigned int selectSy() { return 1 << 11; }
315  static unsigned int selectPx() { return 1 << 12; }
319  static unsigned int selectPy() { return 1 << 13; }
320 
324  void printLsofInvariants(std::ostream &os) const;
325 
326  friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpFeatureMomentCInvariant &featcinv);
327 };
328 #endif
329 #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.