38 #include <visp3/core/vpConfig.h>
40 #ifdef VISP_MOMENTS_COMBINE_MATRICES
45 #include <visp3/core/vpMomentObject.h>
46 #include <visp3/core/vpMomentCentered.h>
47 #include <visp3/core/vpMomentAreaNormalized.h>
48 #include <visp3/core/vpMomentGravityCenter.h>
49 #include <visp3/visual_features/vpFeatureMomentGravityCenter.h>
50 #include <visp3/visual_features/vpFeatureMomentAreaNormalized.h>
51 #include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h>
52 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
64 bool found_moment_gravity;
65 bool found_moment_surface_normalized;
67 bool found_featuremoment_gravity;
68 bool found_featuremoment_surfacenormalized;
94 #include <visp3/core/vpMomentObject.h>
95 #include <visp3/core/vpMomentCentered.h>
96 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
97 #include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h>
98 #include <visp3/core/vpMomentAreaNormalized.h>
99 #include <visp3/core/vpMomentGravityCenter.h>
112 bool found_moment_surface_normalized;
113 bool found_moment_gravity;
114 bool found_moment_centered;
129 double n11 = momentCentered.
get(1,1)/momentObject.
get(0,0);
130 double n20 = momentCentered.
get(2,0)/momentObject.
get(0,0);
131 double n02 = momentCentered.
get(0,2)/momentObject.
get(0,0);
132 double n10 = momentCentered.
get(1,0)/momentObject.
get(0,0);
133 double n01 = momentCentered.
get(0,1)/momentObject.
get(0,0);
134 double n03 = momentCentered.
get(0,3)/momentObject.
get(0,0);
137 double Xg = momentGravity.
getXg();
138 double Yg = momentGravity.
getYg();
140 double An=momentSurfaceNormalized.
get()[0];
146 double Xnvx,Xnvy,Xnvz,Xnwx,Xnwy;
147 double Ynvx,Ynvy,Ynvz,Ynwx,Ynwy;
150 double a = momentCentered.
get(2,0)+momentCentered.
get(0,2);
152 double e11 = momentCentered.
get(1,1)/a;
153 double e12 = momentCentered.
get(1,2)/a;
154 double e21 = momentCentered.
get(2,1)/a;
155 double e30 = momentCentered.
get(3,0)/a;
160 Xnvx =
B*Xn*e11-Yn*
B-An*
C-n02*
A*Xn/NA;
161 Xnvy =
A*Xn*e11+n02*
B*Xn/NA;
163 Xnwx = An*e11*NA+Yn*n10-Xn*Xg*e11+Xn*n01+Xn*n10*e11-Xn*e21+(-Xn*n03+(Xn*n01-Yn*Xg)*n02)/NA;
164 Xnwy = -An*NA+Xn*e12+Xn*Xg-An+e11*Xg*Yn-Xn*n01*e11-2*Xn*n10+Xn*e30+n02*An+(-Xn*Xg+Xn*n10)*n02/NA;
168 Ynvx = (Yn-n02*Yn/NA)*
A+Yn*e11*
B;
169 Ynvy = (-Xn+e11*Yn)*
A+(-Yn+n02*Yn/NA)*
B-An*
C;
171 Ynwx = n02*An+Yn*n10*e11-e11*Xg*Yn+An-Yn*e21+Yn*n01+(-Yn*n03+(Yn*n01-Yn*Yg)*n02)/NA;
172 Ynwy = -An*e11*NA+Yn*e11*Yg-Yn*n01*e11+Yn*Xg+Yn*e12+Yn*e30-Xn*n01-2*Yn*n10+(Yn*n10-Yn*Xg)*n02/NA;
176 Xnvx = -An*
C-
A*Xn-Yn*
B;
179 Xnwx = (0.5*(8.*n10-Xg))*Yn+4.*An*n11+4.*n01*Xn;
180 Xnwy = (0.5*(-2.-8.*n20))*An+(0.5)*Xn*(-8.*n10+Xg);
183 Ynvy = -(0.5)*B*Yn-
C*An-
A*Xn;
185 Ynwx = (0.5)*Yn*(8.*n01-Yg)+(.5*(2.+8.*n02))*An;
186 Ynwy = (0.5*(-8.*n10+Xg))*Yn-4.*An*n11-4.*n01*Xn;
190 Ynvz = -
A*Ynwy+(-An+Ynwx)*
B;
191 Xnvz = -
A*An-
A*Xnwy+
B*Xnwx;
Class handling the normalized surface moment that is invariant in scale and used to estimate depth...
const std::vector< double > & get() const
error that can be emited by ViSP classes.
Class for generic objects.
const std::vector< double > & get() const
std::vector< vpMatrix > interaction_matrices
Functionality computation for normalized surface moment feature. Computes the interaction matrix asso...
void compute_interaction()
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
const vpMoment & get(const char *type, bool &found) const
vpMomentDatabase & moments
This class defines the double-indexed centered moment descriptor .
double get(unsigned int i, unsigned int j) const
Class describing 2D gravity center moment.
vpObjectType getType() const
const std::vector< double > & get() const
vpFeatureMomentDatabase * featureMomentsDataBase
const vpMomentObject & getObject() const
Functionality computation for gravity center moment feature. Computes the interaction matrix associat...
vpFeatureMoment & get(const char *type, bool &found)