40 #include <visp3/core/vpMomentAreaNormalized.h>
41 #include <visp3/core/vpMomentGravityCenter.h>
42 #include <visp3/core/vpMomentGravityCenterNormalized.h>
43 #include <visp3/core/vpMomentObject.h>
51 bool found_moment_gravity;
52 bool found_moment_surface_normalized;
55 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
59 if (!found_moment_surface_normalized)
61 if (!found_moment_gravity)
64 double Xn = momentGravity.
get()[0] * momentSurfaceNormalized.
get()[0];
65 double Yn = momentGravity.
get()[1] * momentSurfaceNormalized.
get()[0];
81 os << (__FILE__) << std::endl;
82 os <<
"(Xn,Yn) = (" << m.
values[0] <<
", " << m.
values[1] <<
")" << std::endl;
93 os << (__FILE__) << std::endl;
94 bool found_moment_gravity;
95 bool found_moment_surface_normalized;
98 getMoments().
get(
"vpMomentAreaNormalized", found_moment_surface_normalized));
102 if (!found_moment_surface_normalized)
104 if (!found_moment_gravity)
106 os <<
"Xg = " << momentGravity.
get()[0] <<
"\t"
107 <<
"Yg = " << momentGravity.
get()[1] << std::endl;
108 os <<
"An = " << momentSurfaceNormalized.
get()[0] << 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 char *type, 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