34 #include <visp3/core/vpConfig.h>
36 #ifdef VISP_MOMENTS_COMBINE_MATRICES
40 #include <visp3/core/vpMomentObject.h>
41 #include <visp3/visual_features/vpFeatureMomentBasic.h>
42 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
43 #include <visp3/visual_features/vpFeatureMomentGravityCenter.h>
56 bool found_featuremoment_basic;
62 if (!found_featuremoment_basic)
70 momentObject.
get(1, 0) * pow(momentObject.
get(0, 0), -0.2e1) * featureMomentBasic.
interaction(0, 0);
73 momentObject.
get(0, 1) * pow(momentObject.
get(0, 0), -0.2e1) * featureMomentBasic.
interaction(0, 0);
80 #include <visp3/core/vpMomentCentered.h>
81 #include <visp3/core/vpMomentDatabase.h>
82 #include <visp3/core/vpMomentGravityCenter.h>
83 #include <visp3/core/vpMomentObject.h>
84 #include <visp3/visual_features/vpFeatureMomentGravityCenter.h>
98 bool found_moment_centered;
99 bool found_moment_gravity;
108 if (!found_moment_centered)
110 if (!found_moment_gravity)
122 double n11 = momentCentered.
get(1, 1) / momentObject.
get(0, 0);
123 double n20 = momentCentered.
get(2, 0) / momentObject.
get(0, 0);
124 double n02 = momentCentered.
get(0, 2) / momentObject.
get(0, 0);
125 double Xg = momentGravity.
getXg();
126 double Yg = momentGravity.
getYg();
127 double Zg_inv =
A * Xg +
B * Yg +
C;
128 double Xgvz = Xg * Zg_inv +
A * epsilon * n20 +
B * epsilon * n11;
129 double Ygvz = Yg * Zg_inv +
A * epsilon * n11 +
B * epsilon * n02;
130 double Xgwx = Xg * Yg + epsilon * n11;
132 double Xgwy = -(1 + Xg * Xg + epsilon * n20);
133 double Ygwx = 1 + Yg * Yg + epsilon * n02;
error that can be emitted by ViSP classes.
@ notInitialized
Used to indicate that a parameter is not initialized.
Functionality computation for basic moment feature. Computes the interaction matrix associated with v...
vpMatrix interaction(unsigned int select_one, unsigned int select_two) const
vpFeatureMoment & get(const std::string &feature_name, bool &found)
void compute_interaction() VP_OVERRIDE
std::vector< vpMatrix > interaction_matrices
vpFeatureMomentDatabase * featureMomentsDataBase
vpMomentDatabase & moments
This class defines the double-indexed centered moment descriptor .
double get(unsigned int i, unsigned int j) const
const vpMoment & get(const std::string &moment_name, bool &found) const
Class describing 2D gravity center moment.
Class for generic objects.
const std::vector< double > & get() const
vpObjectType getType() const
const vpMomentObject & getObject() const