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