39 #include <visp3/core/vpConfig.h> 41 #ifdef VISP_MOMENTS_COMBINE_MATRICES 46 #include <visp3/core/vpMomentObject.h> 47 #include <visp3/visual_features/vpFeatureMomentBasic.h> 48 #include <visp3/visual_features/vpFeatureMomentDatabase.h> 49 #include <visp3/visual_features/vpFeatureMomentGravityCenter.h> 61 bool found_featuremoment_basic;
67 if (!found_featuremoment_basic)
75 momentObject.
get(1, 0) * pow(momentObject.
get(0, 0), -0.2e1) * featureMomentBasic.
interaction(0, 0);
78 momentObject.
get(0, 1) * pow(momentObject.
get(0, 0), -0.2e1) * featureMomentBasic.
interaction(0, 0);
86 #include <visp3/core/vpMomentCentered.h> 87 #include <visp3/core/vpMomentDatabase.h> 88 #include <visp3/core/vpMomentGravityCenter.h> 89 #include <visp3/core/vpMomentObject.h> 90 #include <visp3/visual_features/vpFeatureMomentGravityCenter.h> 103 bool found_moment_centered;
104 bool found_moment_gravity;
113 if (!found_moment_centered)
115 if (!found_moment_gravity)
126 double n11 = momentCentered.
get(1, 1) / momentObject.
get(0, 0);
127 double n20 = momentCentered.
get(2, 0) / momentObject.
get(0, 0);
128 double n02 = momentCentered.
get(0, 2) / momentObject.
get(0, 0);
129 double Xg = momentGravity.
getXg();
130 double Yg = momentGravity.
getYg();
131 double Zg_inv =
A * Xg +
B * Yg +
C;
132 double Xgvz = Xg * Zg_inv +
A * epsilon * n20 +
B * epsilon * n11;
133 double Ygvz = Yg * Zg_inv +
A * epsilon * n11 +
B * epsilon * n02;
134 double Xgwx = Xg * Yg + epsilon * n11;
136 double Xgwy = -(1 + Xg * Xg + epsilon * n20);
137 double Ygwx = 1 + Yg * Yg + epsilon * n02;
Functionality computation for basic moment feature. Computes the interaction matrix associated with v...
double get(unsigned int i, unsigned int j) const
const vpMoment & get(const char *type, bool &found) const
error that can be emited by ViSP classes.
Class for generic objects.
std::vector< vpMatrix > interaction_matrices
const vpMomentObject & getObject() const
vpMomentDatabase & moments
const std::vector< double > & get() const
This class defines the double-indexed centered moment descriptor .
vpObjectType getType() const
Class describing 2D gravity center moment.
vpFeatureMomentDatabase * featureMomentsDataBase
vpMatrix interaction(unsigned int select_one, unsigned int select_two) const
Used to indicate that a parameter is not initialized.
void compute_interaction()
vpFeatureMoment & get(const char *type, bool &found)