Visual Servoing Platform  version 3.6.1 under development (2024-12-17)
vpMomentCommon.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  * Pre-filled moment database with all commonly used moments.
32  */
37 #ifndef VPCOMMONMOMENTS_H
38 #define VPCOMMONMOMENTS_H
39 
40 #include <visp3/core/vpMomentAlpha.h>
41 #include <visp3/core/vpMomentArea.h>
42 #include <visp3/core/vpMomentAreaNormalized.h>
43 #include <visp3/core/vpMomentBasic.h>
44 #include <visp3/core/vpMomentCInvariant.h>
45 #include <visp3/core/vpMomentCentered.h>
46 #include <visp3/core/vpMomentDatabase.h>
47 #include <visp3/core/vpMomentGravityCenter.h>
48 #include <visp3/core/vpMomentGravityCenterNormalized.h>
49 
50 #include <vector>
51 
52 BEGIN_VISP_NAMESPACE
53 class vpMomentObject;
54 
100 class VISP_EXPORT vpMomentCommon : public vpMomentDatabase
101 {
102 private:
103  vpMomentBasic momentBasic;
104  vpMomentGravityCenter momentGravity;
105  vpMomentCentered momentCentered;
106  vpMomentGravityCenterNormalized momentGravityNormalized;
107  vpMomentAreaNormalized momentSurfaceNormalized;
108  vpMomentCInvariant *momentCInvariant;
109  vpMomentAlpha momentAlpha;
110  vpMomentArea momentArea;
111 
112  // private:
113  //#ifndef DOXYGEN_SHOULD_SKIP_THIS
114  // vpMomentCommon(const vpMomentCommon &)
115  // : vpMomentDatabase(), momentBasic(), momentGravity(),
116  // momentCentered(), momentGravityNormalized(),
117  // momentSurfaceNormalized(0, 0), momentCInvariant(), momentAlpha(),
118  // momentArea()
119  // {
120  // throw vpException(vpException::functionNotImplementedError, "Not
121  // implemented!");
122  // }
123  // vpMomentCommon &operator=(const vpMomentCommon &){
124  // throw vpException(vpException::functionNotImplementedError, "Not
125  // implemented!"); return *this;
126  // }
127  //#endif
128 
129 public:
130  vpMomentCommon(double dstSurface, const std::vector<double> &ref, double refAlpha, double dstZ = 1.0,
131  bool flg_sxsyfromnormalized = false);
132 
133  virtual ~vpMomentCommon() VP_OVERRIDE;
134 
135  static double getAlpha(vpMomentObject &object);
136  static std::vector<double> getMu3(vpMomentObject &object);
137  static double getSurface(vpMomentObject &object);
138 
139  void updateAll(vpMomentObject &object) VP_OVERRIDE;
140 };
141 END_VISP_NAMESPACE
142 #endif // VPCOMMONMOMENTS_H
This class defines the orientation of the object inside the plane parallel to the object.
Class handling the normalized surface moment that is invariant in scale and used to estimate depth.
Class handling the surface moment.
Definition: vpMomentArea.h:59
This class defines the 2D basic moment . This class is a wrapper for vpMomentObject which allows to u...
Definition: vpMomentBasic.h:73
This class defines the double-indexed centered moment descriptor .
This class initializes and allows access to commonly used moments.
This class allows to register all vpMoments so they can access each other according to their dependen...
virtual void updateAll(vpMomentObject &object)
Class describing 2D normalized gravity center moment.
Class describing 2D gravity center moment.
Class for generic objects.