42 #include <visp/vpMomentObject.h>
43 #include <visp/vpMomentGravityCenter.h>
44 #include <visp/vpFeatureMomentAlpha.h>
45 #include <visp/vpMomentCentered.h>
46 #include <visp/vpFeatureMomentCentered.h>
47 #include <visp/vpFeatureMomentDatabase.h>
52 #ifdef VISP_MOMENTS_COMBINE_MATRICES
62 bool found_moment_centered;
63 bool found_FeatureMoment_centered;
71 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));
87 bool found_moment_centered;
88 bool found_moment_gravity;
98 double mu11 = momentCentered.
get(1,1);
99 double mu20 = momentCentered.
get(2,0);
100 double mu02 = momentCentered.
get(0,2);
101 double mu12 = momentCentered.
get(1,2);
102 double mu21 = momentCentered.
get(2,1);
103 double mu03 = momentCentered.
get(0,3);
104 double mu30 = momentCentered.
get(3,0);
106 double Xg = momentGravity.
getXg();
107 double Yg = momentGravity.
getYg();
109 double Avx,Avy,Avz,Awx,Awy;
120 double d = (mu20-mu02)*(mu20-mu02) + 4 * mu11*mu11;
121 double DA = mu20+mu02;
123 double mu11_2 = mu11*mu11;
125 Avx = mu11*DA*
A/d+(DA*mu02+(0.5)*d-(0.5)*DA_2)*
B/d;
126 Avy = (DA*mu02-(0.5)*d-(.5)*DA_2)*
A/d-
B*mu11*DA/d;
128 Awx = (beta*(mu12*(mu20-mu02)+mu11*(mu03-mu21))+gamma*Xg*(mu02*(mu20-mu02)-2*mu11_2)+gamma*Yg*mu11*(mu20+mu02))/d;
129 Awy = (beta*(mu21*(mu02-mu20)+mu11*(mu30-mu12))+gamma*Xg*mu11*(mu20+mu02)+gamma*Yg*(mu20*(mu02-mu20)-2*mu11_2))/d;
153 double err =
s[0] - s_star[0] ;
155 if (err < -M_PI) err += 2*M_PI ;
156 if (err > M_PI) err -= 2*M_PI ;
vpMomentObject & getObject() const
Functionality computation for centered moment feature. Computes the interaction matrix associated wit...
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
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.
class that defines what is a visual feature
vpMoment & get(const char *type, bool &found)
vpMomentDatabase & moments
This class defines the double-indexed centered moment descriptor .
Class describing 2D gravity center moment.
static vpMatrix stackMatrices(const vpMatrix &A, const vpMatrix &B)
Stack two Matrices C = [ A B ]^T.
vpObjectType getType() const
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void compute_interaction()
vpMatrix interaction(unsigned int select_one, unsigned int select_two)
vpFeatureMoment & get(const char *type, bool &found)
vpColVector s
State of the visual feature.