40 #include <visp3/core/vpMomentAreaNormalized.h>
41 #include <visp3/core/vpMomentGravityCenter.h>
42 #include <visp3/core/vpMomentGravityCenterNormalized.h>
43 #include <visp3/core/vpMomentObject.h>
52 bool found_moment_gravity;
53 bool found_moment_surface_normalized;
56 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
60 if (!found_moment_surface_normalized)
62 if (!found_moment_gravity)
65 double Xn = momentGravity.
get()[0] * momentSurfaceNormalized.
get()[0];
66 double Yn = momentGravity.
get()[1] * momentSurfaceNormalized.
get()[0];
84 os << (__FILE__) << std::endl;
85 bool found_moment_gravity;
86 bool found_moment_surface_normalized;
89 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
93 if (!found_moment_surface_normalized)
95 if (!found_moment_gravity)
97 os <<
"Xg = " << momentGravity.
get()[0] <<
"\t"
98 <<
"Yg = " << momentGravity.
get()[1] << std::endl;
99 os <<
"An = " << momentSurfaceNormalized.
get()[0] << std::endl;
107 os << (__FILE__) << std::endl;
108 os <<
"(Xn,Yn) = (" << m.
values[0] <<
", " << m.
values[1] <<
")" << std::endl;
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
error that can be emitted by ViSP classes.
@ notInitialized
Used to indicate that a parameter is not initialized.
Class handling the normalized surface moment that is invariant in scale and used to estimate depth.
const vpMoment & get(const std::string &moment_name, bool &found) const
Class describing 2D normalized gravity center moment.
vpMomentGravityCenterNormalized()
void printDependencies(std::ostream &os) const
Class describing 2D gravity center moment.
const std::vector< double > & get() const
std::vector< double > values
vpMomentDatabase & getMoments() const
const std::vector< double > & get() const