Visual Servoing Platform  version 3.6.1 under development (2024-03-29)
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 class vpMomentObject;
53 
99 class VISP_EXPORT vpMomentCommon : public vpMomentDatabase
100 {
101 private:
102  vpMomentBasic momentBasic;
103  vpMomentGravityCenter momentGravity;
104  vpMomentCentered momentCentered;
105  vpMomentGravityCenterNormalized momentGravityNormalized;
106  vpMomentAreaNormalized momentSurfaceNormalized;
107  vpMomentCInvariant *momentCInvariant;
108  vpMomentAlpha momentAlpha;
109  vpMomentArea momentArea;
110 
111  // private:
112  //#ifndef DOXYGEN_SHOULD_SKIP_THIS
113  // vpMomentCommon(const vpMomentCommon &)
114  // : vpMomentDatabase(), momentBasic(), momentGravity(),
115  // momentCentered(), momentGravityNormalized(),
116  // momentSurfaceNormalized(0, 0), momentCInvariant(), momentAlpha(),
117  // momentArea()
118  // {
119  // throw vpException(vpException::functionNotImplementedError, "Not
120  // implemented!");
121  // }
122  // vpMomentCommon &operator=(const vpMomentCommon &){
123  // throw vpException(vpException::functionNotImplementedError, "Not
124  // implemented!"); return *this;
125  // }
126  //#endif
127 
128 public:
129  vpMomentCommon(double dstSurface, const std::vector<double> &ref, double refAlpha, double dstZ = 1.0,
130  bool flg_sxsyfromnormalized = false);
131 
132  virtual ~vpMomentCommon() vp_override;
133 
134  static double getAlpha(vpMomentObject &object);
135  static std::vector<double> getMu3(vpMomentObject &object);
136  static double getSurface(vpMomentObject &object);
137 
138  void updateAll(vpMomentObject &object) vp_override;
139 };
140 #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:57
This class defines the 2D basic moment . This class is a wrapper for vpMomentObject wich allows to us...
Definition: vpMomentBasic.h:70
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.