39 #include <visp3/core/vpMomentCommon.h>
40 #include <visp3/core/vpMomentObject.h>
55 bool flg_sxsyfromnormalized)
56 :
vpMomentDatabase(), momentBasic(), momentGravity(), momentCentered(), momentGravityNormalized(),
57 momentSurfaceNormalized(dstSurface, dstZ), momentCInvariant(), momentAlpha(ref, refAlpha), momentArea()
62 momentGravity.
linkTo(*
this);
63 momentCentered.
linkTo(*
this);
64 momentGravityNormalized.
linkTo(*
this);
65 momentSurfaceNormalized.
linkTo(*
this);
66 momentCInvariant->
linkTo(*
this);
136 momentSurfaceNormalized.
compute();
137 momentGravityNormalized.
compute();
140 }
catch (
const char *ex) {
141 std::cout <<
"exception:" << ex << std::endl;
154 momentGravity.
linkTo(moments);
156 momentCentered.
linkTo(moments);
165 a = momentCentered.
get(2, 0) + momentCentered.
get(0, 2);
167 a =
object.get(0, 0);
181 momentGravity.
linkTo(moments);
183 momentCentered.
linkTo(moments);
185 momentAlpha.
linkTo(moments);
192 return momentAlpha.
get();
204 momentGravity.
linkTo(moments);
206 momentCentered.
linkTo(moments);
213 std::vector<double> mu(4);
214 unsigned int idx = 0;
215 for (
unsigned int j = 0; j < 4; j++) {
216 for (
unsigned int i = 0; i < 4; i++) {
218 mu[idx] = momentCentered.
get(i, j);
228 if (momentCInvariant)
229 delete momentCInvariant;
This class defines the orientation of the object inside the plane parallel to the object.
This class defines the double-indexed centered moment descriptor .
double get(unsigned int i, unsigned int j) const
static std::vector< double > getMu3(vpMomentObject &object)
virtual ~vpMomentCommon()
vpMomentCommon(double dstSurface, const std::vector< double > &ref, double refAlpha, double dstZ=1.0, bool flg_sxsyfromnormalized=false)
void updateAll(vpMomentObject &object)
static double getAlpha(vpMomentObject &object)
static double getSurface(vpMomentObject &object)
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 gravity center moment.
Class for generic objects.
void linkTo(vpMomentDatabase &moments)