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()
61 momentBasic.linkTo(*
this);
62 momentGravity.linkTo(*
this);
63 momentCentered.linkTo(*
this);
64 momentGravityNormalized.linkTo(*
this);
65 momentSurfaceNormalized.linkTo(*
this);
66 momentCInvariant->linkTo(*
this);
67 momentAlpha.linkTo(*
this);
68 momentArea.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;