38 #include <visp3/core/vpMomentObject.h>
39 #include <visp3/core/vpMomentGravityCenter.h>
40 #include <visp3/visual_features/vpFeatureMomentAlpha.h>
41 #include <visp3/core/vpMomentCentered.h>
42 #include <visp3/visual_features/vpFeatureMomentCentered.h>
43 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
48 #ifdef VISP_MOMENTS_COMBINE_MATRICES
58 bool found_moment_centered;
59 bool found_FeatureMoment_centered;
67 double multiplier = -1./(momentCentered.
get(2,0)*momentCentered.
get(2,0)-2*momentCentered.
get(0,2)*momentCentered.
get(2,0)+4*momentCentered.
get(1,1)*momentCentered.
get(1,1)+momentCentered.
get(0,2)*momentCentered.
get(0,2));
83 bool found_moment_centered;
84 bool found_moment_gravity;
94 double mu11 = momentCentered.
get(1,1);
95 double mu20 = momentCentered.
get(2,0);
96 double mu02 = momentCentered.
get(0,2);
97 double mu12 = momentCentered.
get(1,2);
98 double mu21 = momentCentered.
get(2,1);
99 double mu03 = momentCentered.
get(0,3);
100 double mu30 = momentCentered.
get(3,0);
102 double Xg = momentGravity.
getXg();
103 double Yg = momentGravity.
getYg();
105 double Avx,Avy,Avz,Awx,Awy;
116 double d = (mu20-mu02)*(mu20-mu02) + 4 * mu11*mu11;
117 double DA = mu20+mu02;
119 double mu11_2 = mu11*mu11;
121 Avx = mu11*DA*
A/d+(DA*mu02+(0.5)*d-(0.5)*DA_2)*
B/d;
122 Avy = (DA*mu02-(0.5)*d-(.5)*DA_2)*
A/d-
B*mu11*DA/d;
124 Awx = (beta*(mu12*(mu20-mu02)+mu11*(mu03-mu21))+gamma*Xg*(mu02*(mu20-mu02)-2*mu11_2)+gamma*Yg*mu11*(mu20+mu02))/d;
125 Awy = (beta*(mu21*(mu02-mu20)+mu11*(mu30-mu12))+gamma*Xg*mu11*(mu20+mu02)+gamma*Yg*(mu20*(mu02-mu20)-2*mu11_2))/d;
149 double err =
s[0] - s_star[0] ;
151 if (err < -M_PI) err += 2*M_PI ;
152 if (err > M_PI) err -= 2*M_PI ;
void stack(const double &d)
Functionality computation for centered moment feature. Computes the interaction matrix associated wit...
error that can be emited by ViSP classes.
Class for generic objects.
std::vector< vpMatrix > interaction_matrices
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
Compute the error between two visual features from a subset of the possible features.
vpMatrix interaction(unsigned int select_one, unsigned int select_two) const
class that defines what is a visual feature
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
vpFeatureMomentDatabase * featureMomentsDataBase
Implementation of column vector and the associated operations.
void compute_interaction()
const vpMomentObject & getObject() const
vpFeatureMoment & get(const char *type, bool &found)
vpColVector s
State of the visual feature.