38 #include <visp3/core/vpMomentCentered.h>
39 #include <visp3/core/vpMomentObject.h>
40 #include <visp3/core/vpMomentGravityCenter.h>
62 bool found_moment_gravity;
69 for(
register unsigned int j=0;j<(order);j++){
70 for(
register unsigned int i=0;i<order-j;i++){
71 unsigned int c = order*j+i;
73 for(
register unsigned int k=0;k<=i;k++){
74 double Xg_i_k = pow(-momentGravity.
get()[0],(int)(i-k));
75 double comb_i_k =
static_cast<double>(
vpMath::comb(i,k) );
76 for(
register unsigned int l=0;l<=j;l++){
105 return values[j*(order+1)+i];
125 for(
unsigned int i = 0;i<m.
values.size();i++){
147 for(
unsigned int k=0; k<orderp1; k++) {
148 for(
unsigned int l=0; l<orderp1-k; l++)
150 os <<
"mu[" << k <<
"," << l <<
"] = " << this->
get(k,l) <<
"\t";
165 os << (__FILE__) << std::endl;
175 bool found_moment_gravity;
177 if(!found_moment_gravity)
179 os <<
"Xg = " << momentGravity.
getXg() <<
"\t" <<
"Yg = " << momentGravity.
getYg() << std::endl;
static void printWithIndices(const vpMomentObject &momobj, std::ostream &os)
error that can be emited by ViSP classes.
Class for generic objects.
const std::vector< double > & get() const
const std::vector< double > & get() const
void printWithIndices(std::ostream &os) const
This class defines shared methods/attributes for 2D moments.
const vpMoment & get(const char *type, bool &found) const
This class defines the double-indexed centered moment descriptor .
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Class describing 2D gravity center moment.
vpMomentDatabase & getMoments() const
const std::vector< double > & get() const
static long double comb(unsigned int n, unsigned int p)
void printDependencies(std::ostream &os) const
const vpMomentObject & getObject() const
std::vector< double > values
void set(unsigned int i, unsigned int j, double value)
unsigned int getOrder() const