42 #include <visp/vpConfig.h>
44 #ifdef VISP_MOMENTS_COMBINE_MATRICES
49 #include <visp/vpMomentObject.h>
50 #include <visp/vpMomentCentered.h>
51 #include <visp/vpMomentAreaNormalized.h>
52 #include <visp/vpMomentGravityCenter.h>
53 #include <visp/vpFeatureMomentGravityCenter.h>
54 #include <visp/vpFeatureMomentAreaNormalized.h>
55 #include <visp/vpFeatureMomentGravityCenterNormalized.h>
56 #include <visp/vpFeatureMomentDatabase.h>
68 bool found_moment_gravity;
69 bool found_moment_surface_normalized;
71 bool found_featuremoment_gravity;
72 bool found_featuremoment_surfacenormalized;
98 #include <visp/vpMomentObject.h>
99 #include <visp/vpMomentCentered.h>
100 #include <visp/vpFeatureMomentDatabase.h>
101 #include <visp/vpFeatureMomentGravityCenterNormalized.h>
102 #include <visp/vpMomentAreaNormalized.h>
103 #include <visp/vpMomentGravityCenter.h>
116 bool found_moment_surface_normalized;
117 bool found_moment_gravity;
118 bool found_moment_centered;
133 double n11 = momentCentered.
get(1,1)/momentObject.
get(0,0);
134 double n20 = momentCentered.
get(2,0)/momentObject.
get(0,0);
135 double n02 = momentCentered.
get(0,2)/momentObject.
get(0,0);
136 double n10 = momentCentered.
get(1,0)/momentObject.
get(0,0);
137 double n01 = momentCentered.
get(0,1)/momentObject.
get(0,0);
138 double n03 = momentCentered.
get(0,3)/momentObject.
get(0,0);
141 double Xg = momentGravity.
getXg();
142 double Yg = momentGravity.
getYg();
144 double An=momentSurfaceNormalized.
get()[0];
150 double Xnvx,Xnvy,Xnvz,Xnwx,Xnwy;
151 double Ynvx,Ynvy,Ynvz,Ynwx,Ynwy;
154 double a = momentCentered.
get(2,0)+momentCentered.
get(0,2);
156 double e11 = momentCentered.
get(1,1)/a;
157 double e12 = momentCentered.
get(1,2)/a;
158 double e21 = momentCentered.
get(2,1)/a;
159 double e30 = momentCentered.
get(3,0)/a;
164 Xnvx =
B*Xn*e11-Yn*
B-An*
C-n02*
A*Xn/NA;
165 Xnvy =
A*Xn*e11+n02*
B*Xn/NA;
167 Xnwx = An*e11*NA+Yn*n10-Xn*Xg*e11+Xn*n01+Xn*n10*e11-Xn*e21+(-Xn*n03+(Xn*n01-Yn*Xg)*n02)/NA;
168 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;
172 Ynvx = (Yn-n02*Yn/NA)*
A+Yn*e11*
B;
173 Ynvy = (-Xn+e11*Yn)*
A+(-Yn+n02*Yn/NA)*
B-An*
C;
175 Ynwx = n02*An+Yn*n10*e11-e11*Xg*Yn+An-Yn*e21+Yn*n01+(-Yn*n03+(Yn*n01-Yn*Yg)*n02)/NA;
176 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;
180 Xnvx = -An*
C-
A*Xn-Yn*
B;
183 Xnwx = (0.5*(8.*n10-Xg))*Yn+4.*An*n11+4.*n01*Xn;
184 Xnwy = (0.5*(-2.-8.*n20))*An+(0.5)*Xn*(-8.*n10+Xg);
187 Ynvy = -(0.5)*B*Yn-
C*An-
A*Xn;
189 Ynwx = (0.5)*Yn*(8.*n01-Yg)+(.5*(2.+8.*n02))*An;
190 Ynwy = (0.5*(-8.*n10+Xg))*Yn-4.*An*n11-4.*n01*Xn;
194 Ynvz = -
A*Ynwy+(-An+Ynwx)*
B;
195 Xnvz = -
A*An-
A*Xnwy+
B*Xnwx;
Class handling the normalized surface moment that is invariant in scale and used to estimate depth...
vpMomentObject & getObject() const
double get(unsigned int i, unsigned int j)
error that can be emited by ViSP classes.
Class for generic objects.
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)
vpMoment & get(const char *type, bool &found)
std::vector< double > & get()
vpMomentDatabase & moments
This class defines the double-indexed centered moment descriptor .
Class describing 2D gravity center moment.
vpObjectType getType() const
std::vector< double > & get()
Functionality computation for gravity center moment feature. Computes the interaction matrix associat...
std::vector< double > & get()
vpFeatureMoment & get(const char *type, bool &found)