Visual Servoing Platform  version 3.6.1 under development (2024-02-13)
vpFeatureMomentCInvariant.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
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 https://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 
38 #ifndef _vpFeatureMomentCInvariant_h_
39 #define _vpFeatureMomentCInvariant_h_
40 
41 #include <visp3/visual_features/vpFeatureMoment.h>
42 
43 #ifdef VISP_MOMENTS_COMBINE_MATRICES
89 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
90 {
91 public:
102  vpFeatureMomentCInvariant(vpMomentDatabase &moments, double A, double B, double C,
103  vpFeatureMomentDatabase *featureMoments = nullptr)
104  : vpFeatureMoment(moments, A, B, C, featureMoments, 16)
105  { }
106 
107  void compute_interaction() vp_override;
108 
112  const std::string momentName() const vp_override
113  {
114  return "vpMomentCInvariant";
115  }
116 
120  const std::string name() const vp_override
121  {
122  return "vpFeatureMomentCInvariant";
123  }
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 
231 class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
232 {
233 private:
234  std::vector<vpMatrix> LI;
235 
236 public:
247  vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_,
248  vpFeatureMomentDatabase *featureMoments = nullptr)
249  : vpFeatureMoment(data_base, A_, B_, C_, featureMoments, 16), LI(16)
250  { }
251 
252  void compute_interaction() vp_override;
256  const std::string momentName() const vp_override
257  {
258  return "vpMomentCInvariant";
259  }
263  const std::string name() const vp_override
264  {
265  return "vpFeatureMomentCInvariant";
266  }
267 
271  static unsigned int selectC1() { return 1 << 0; }
275  static unsigned int selectC2() { return 1 << 1; }
279  static unsigned int selectC3() { return 1 << 2; }
283  static unsigned int selectC4() { return 1 << 3; }
287  static unsigned int selectC5() { return 1 << 4; }
291  static unsigned int selectC6() { return 1 << 5; }
295  static unsigned int selectC7() { return 1 << 6; }
299  static unsigned int selectC8() { return 1 << 7; }
303  static unsigned int selectC9() { return 1 << 8; }
307  static unsigned int selectC10() { return 1 << 9; }
311  static unsigned int selectSx() { return 1 << 10; }
315  static unsigned int selectSy() { return 1 << 11; }
319  static unsigned int selectPx() { return 1 << 12; }
323  static unsigned int selectPy() { return 1 << 13; }
324 
328  void printLsofInvariants(std::ostream &os) const;
329 
330  friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpFeatureMomentCInvariant &featcinv);
331 };
332 #endif
333 #endif
Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature....
const std::string name() const vp_override
vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_, vpFeatureMomentDatabase *featureMoments=nullptr)
This class allows to register all feature moments (implemented in vpFeatureMoment....
This class defines shared system methods/attributes for 2D moment features but no functional code....
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpFeatureMoment &featM)
virtual const std::string name() const =0
virtual void compute_interaction(void)
This class allows to register all vpMoments so they can access each other according to their dependen...